From owner-p4-projects@FreeBSD.ORG Wed Sep 12 23:31:47 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3F4ED16A469; Wed, 12 Sep 2007 23:31:47 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1634916A41B for ; Wed, 12 Sep 2007 23:31:47 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.187]) by mx1.freebsd.org (Postfix) with ESMTP id 728B013C461 for ; Wed, 12 Sep 2007 23:31:46 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so328206nfb for ; Wed, 12 Sep 2007 16:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=2+MOCknaauY3V2Li9kMXm8QE4XSDqHI2hQ/jMt3NKEk=; b=BhPz68XM4Bn/lclpXK979lmAOh0XU9uyOVb7q2uqHLS6S0Oz3lwrvkYdC6w5p7IZ57tVSgy98ozP1AQ47bQrU8n7SGkqImq4l+XDnilVNz3ATcrOncu1leI/ZYvnjIsun6wxY/3UGC1aMf7wH+GIZ77HfFrGjnJYk2aOiM677eE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=QQq5wn/EUL7w4PJdOilBZ79wfsBN1ttfczktpxCW7wQi7bHvfbSWO/TyidAlGAYwOT9LTKITSK3T0HtiyufHWAO9hDPlPiffiGiFw4MGlRqvD1ScN9TcuuZmJM4f76QJrnXRwHSs0GROShG1ujfs8oOKdo0f+2kiH6zuM3bVeq8= Received: by 10.78.188.10 with SMTP id l10mr47685huf.1189639904743; Wed, 12 Sep 2007 16:31:44 -0700 (PDT) Received: by 10.78.120.9 with HTTP; Wed, 12 Sep 2007 16:31:44 -0700 (PDT) Message-ID: <3bbf2fe10709121631w7b494d0ap3a2495517b6402f7@mail.gmail.com> Date: Thu, 13 Sep 2007 01:31:44 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Pawel Jakub Dawidek" In-Reply-To: <20070912232541.GG4909@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200709120832.l8C8WLlm085731@repoman.freebsd.org> <20070912150017.GA3553@garage.freebsd.pl> <3bbf2fe10709121530h6d0681c4xa247fe7d31cb2c2e@mail.gmail.com> <20070912223833.GC4909@garage.freebsd.pl> <20070912230205.GF4909@garage.freebsd.pl> <3bbf2fe10709121618o3955b1fdm2cdca5b7fea8f6e4@mail.gmail.com> <20070912232541.GG4909@garage.freebsd.pl> X-Google-Sender-Auth: 25964e9c1a526c2c Cc: Kip Macy , Perforce Change Reviews , Kip Macy Subject: Re: PERFORCE change 126330 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2007 23:31:47 -0000 2007/9/13, Pawel Jakub Dawidek : > On Thu, Sep 13, 2007 at 01:18:41AM +0200, Attilio Rao wrote: > > 2007/9/13, Pawel Jakub Dawidek : > > > On Wed, Sep 12, 2007 at 03:49:55PM -0700, Kip Macy wrote: > > > > Andrew Thompson explicitly asked for the possibility of shared acquisition. > > > > > > A flag for callout_init_lock() will be enough? Or it wants it to be > > > sometimes acquired shared and sometimes exclusive? > > > > If it was me I would avoid the 'static' requirement for these stuffs. > > Actually I don't see why one would want to call the same handler with > different locked lock. I think a flag for callout_init_lock() should be > enough, exactly in the same way we have CALLOUT_RETURNUNLOCKED - we > don't decide if the handler returns with lock unlock at callout_reset() > time, but at callout_init_mtx() time. The thing is that you know the > handler and you know if it needs to modify shared data or not at init > time. And for the very uncommon cases, you can always downgrade the lock > from within the handler. > > All in all, I think a flag for callout_init_lock() is enough. Do you > feel convinced? Yes, probabilly having an initialization flag is good enough. I was just thinking if one can find cases where different ways for handler locking can happen, so that having a general way to avoid this would be better. But, as you explain, an intialization flag is a good solution as well (and avoids any external API modify). Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein