Subject: Re: nesting simple_lock and spl*?
To: Jason R Thorpe <thorpej@wasabisystems.com>
From: Darren Reed <darrenr@reed.wattle.id.au>
List: tech-kern
Date: 05/26/2002 12:12:12
In some email I received from Jason R Thorpe, sie wrote:
> On Sat, May 25, 2002 at 08:59:20PM +0100, David Laight wrote:
>
> > I found some problems with the 'solaris' semantics of saving the spl
> > level within the mutex, the 'SVR4' semantics where the spl level
> > is returned to the user are more flexible.
>
> Some say "flexible", others say "error-prone".
>
> > pl1 = read_lock( table_lock )
> > entry = search_table( key );
> > pl2 = lock( entry->lock );
> > unlock( table_lock, pl2 );
> > .....
> > unlock( entry->lock, pl1 );
>
> You can already do this with Solaris-style mutexes if they are adaptive
> mutexes. Interrupt-blocking mutexes are meant to not be used that often
> in the Solaris kernel (and I happen to agree with their approach).
It'd be very cool if we could have adaptive mutexes in NetBSD.
Darren