cvs commit: src/share/man/man9 Makefile condvar.9 lock.9 mi_switch.9 mtx_pool.9 mutex.9 rwlock.9 sleep.9 sleepqueue.9 sx.9 thread_exit.9 src/sys/kern kern_synch.c src/sys/sys mutex.h rwlock.h sleepqueue.h sx.h systm.h

Robert Watson rwatson at FreeBSD.org
Tue Mar 13 00:05:01 UTC 2007


On Mon, 12 Mar 2007, Julian Elischer wrote:

> John Baldwin wrote:
>> Will try to pass 'lock' to three different functions, at least 2 of which 
>> will trigger compile errors. :)  The kernel won't choose which one to run 
>> until runtime though.  The key is that I want a compile error, not a 
>> panic(). :)
>
> I've been asking for awhile that for example spin and sleep mutexes should 
> be different types so that we could catch those problems at compile time.

The idea of a locking(9) has been kicked around for a while, and its time has 
definitely come.  It would summarize the properties and cross reference the 
man pages of the various primitives, and suggest a preference and strategy for 
using them in new code vs. existing code, etc.  Distinguishing dimensions 
would include things like whether it is sleepable, supports priority 
propagation, can be acquired in interrupt context (a result of the prior two 
properties), whether it is fair, etc, etc.  And include stern warnings about 
not using lockmgr in new code :-).

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the cvs-src mailing list