Subject: Re: New spl level: splsched()
To: Erik E. Fair <fair@clock.org>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 03/05/1997 14:10:18
On Mon, 3 Mar 1997 00:03:09 -0800 
 "Erik E. Fair" (Time Keeper) <fair@clock.org> wrote:

 > Isn't it time we started using a new mutual exclusion technique that is
 > semaphore based, instead of interrupt based? We're going to need that if we
 > ever have any SMP aspirations.

To answer your question, "yes", but it's worth noting that it changes
a LOT of code...

I would like to see some of these changes made, tho... basically,
I think that we should start using things like:

	mutex_enter(...);

	/* do stuff */

	mutex_exit(...);

For now, these could be implemented something like:

typedef	int	mutex_t;

#define	mutex_enter(m)	(m) = splwhatever()
#define	mutex_exit(m)	splx((m))

..obviously, not that simple, since you have to know which spl to go
to... but that might be a reasonable thing to start doing, so that
we can just drop in new guts for the mutex primitives when the kernel
becomes multi-threaded.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939