PERFORCE change 126330 for review

Andrew Thompson thompsa at FreeBSD.org
Wed Sep 12 16:19:24 PDT 2007


On Wed, Sep 12, 2007 at 03:49:55PM -0700, Kip Macy wrote:
> Andrew Thompson explicitly asked for the possibility of shared acquisition.
 
I dont have a use for shared acquisition at the moment but I imagine it
could be handy.
 
> On 9/12/07, Pawel Jakub Dawidek <pjd at freebsd.org> wrote:
> > On Thu, Sep 13, 2007 at 12:30:26AM +0200, Attilio Rao wrote:
> > > 2007/9/12, Kip Macy <kip.macy at gmail.com>:
> > > > On 9/12/07, Pawel Jakub Dawidek <pjd at freebsd.org> wrote:
> > > > > On Wed, Sep 12, 2007 at 08:32:21AM +0000, Kip Macy wrote:
> > > > > > http://perforce.freebsd.org/chv.cgi?CH=126330
> > > > > >
> > > > > > Change 126330 by kmacy at kmacy_home:ethng on 2007/09/12 08:31:36
> > > > > >
> > > > > >       convert radix node head and route locks from mutexes to rwlocks
> > > > > [...]
> > > > > >               rt->rt_flags |= RTF_LLINFO;
> > > > > > -             callout_init_mtx(&la->la_timer, &rt->rt_mtx,
> > > > > > -                 CALLOUT_RETURNUNLOCKED);
> > > > > > +             callout_init_rwlock(&la->la_timer, &rt->rt_lock,
> > > > > > +                 CALLOUT_RETURNUNLOCKED_RW);
> > > > > >
> > > > >
> > > > > Kip, don't add callout_init_rwlock() to the tree. I've
> > > > > callout_init_lock() implemented that operates on any lock type, just
> > > > > like condvar(9).
> > > >
> > > > point me to a diff
> > >
> > > I'm courious to know another thing instead.
> > > As like condvar() works, it is allowed to before release and later
> > > acquire the lock.
> > > This scheme let you acquire the lock again following the previous
> > > pattern for sx and rw locks (if for example you had a rwlock mantained
> > > in write mode you will acquire it in the same way).
> > > This is not applicable to callout, instead, as you have the lock
> > > 'blank', so with double-kind locks (like rw and sx) how do you lock
> > > it?
> >
> > Always write/exclusive.
> >
> > --
> > Pawel Jakub Dawidek                       http://www.wheel.pl
> > pjd at FreeBSD.org                           http://www.FreeBSD.org
> > FreeBSD committer                         Am I Evil? Yes, I Am!
> >
> >


More information about the p4-projects mailing list