From owner-p4-projects Fri Feb 21 10:35:36 2003 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3B9F437B405; Fri, 21 Feb 2003 10:35:34 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C45DE37B401 for ; Fri, 21 Feb 2003 10:35:33 -0800 (PST) Received: from mail.speakeasy.net (mail16.speakeasy.net [216.254.0.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0EC5A43F75 for ; Fri, 21 Feb 2003 10:35:33 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 7903 invoked from network); 21 Feb 2003 18:35:37 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail16.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 21 Feb 2003 18:35:37 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id h1LIZ3hT004665; Fri, 21 Feb 2003 13:35:03 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200302211742.h1LHgptx095984@repoman.freebsd.org> Date: Fri, 21 Feb 2003 13:35:43 -0500 (EST) From: John Baldwin To: John Baldwin Subject: RE: PERFORCE change 25536 for review Cc: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 21-Feb-2003 John Baldwin wrote: > http://perforce.freebsd.org/chv.cgi?CH=25536 > > Change 25536 by jhb@jhb_laptop on 2003/02/21 09:41:54 > > Real eventhandler locking without evilness. Highlights: > - Uses mutex rather than a sx lock for each list. > - We use a runcount that we increment when starting to invoke a > list and decrement when finished invoking a list. > - When deleteing a handler, if the runcount is not 0, we mark > the event as dead using a reserved priority value (-1) rather > than removing it from the list right then and there. > - When we finish invoking a list and the runcount goes down to 0, > we prune the list of any dead handlers. > - A bit more sane locking is used. > - All the %^&#ing code duplication in the invoke methods is gone > by having the two invoke macros lookup and lock the list before > calling a common macro. > - The pruning of the list is a function so as to not bloat the > invoke macros too much. Cons: not compiled or tested yet. :) -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message