Date: Thu, 13 Sep 2007 01:31:44 +0200 From: "Attilio Rao" <attilio@freebsd.org> To: "Pawel Jakub Dawidek" <pjd@freebsd.org> Cc: Kip Macy <kip.macy@gmail.com>, Perforce Change Reviews <perforce@freebsd.org>, Kip Macy <kmacy@freebsd.org> Subject: Re: PERFORCE change 126330 for review Message-ID: <3bbf2fe10709121631w7b494d0ap3a2495517b6402f7@mail.gmail.com> In-Reply-To: <20070912232541.GG4909@garage.freebsd.pl> References: <200709120832.l8C8WLlm085731@repoman.freebsd.org> <20070912150017.GA3553@garage.freebsd.pl> <b1fa29170709121450r5f59430bqa13373fdf807cadc@mail.gmail.com> <3bbf2fe10709121530h6d0681c4xa247fe7d31cb2c2e@mail.gmail.com> <20070912223833.GC4909@garage.freebsd.pl> <b1fa29170709121549m7218965fs2682c8b5bd63e58b@mail.gmail.com> <20070912230205.GF4909@garage.freebsd.pl> <3bbf2fe10709121618o3955b1fdm2cdca5b7fea8f6e4@mail.gmail.com> <20070912232541.GG4909@garage.freebsd.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
2007/9/13, Pawel Jakub Dawidek <pjd@freebsd.org>: > On Thu, Sep 13, 2007 at 01:18:41AM +0200, Attilio Rao wrote: > > 2007/9/13, Pawel Jakub Dawidek <pjd@freebsd.org>: > > > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3bbf2fe10709121631w7b494d0ap3a2495517b6402f7>