Date: Tue, 13 Mar 2007 01:04:58 +0100 (BST) From: Robert Watson <rwatson@FreeBSD.org> To: Julian Elischer <julian@elischer.org> Cc: src-committers@freebsd.org, Pawel Jakub Dawidek <pjd@freebsd.org>, John Baldwin <jhb@freebsd.org>, cvs-src@freebsd.org, cvs-all@freebsd.org, Attilio Rao <attilio@freebsd.org> Subject: Re: 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 Message-ID: <20070313010309.Q25395@fledge.watson.org> In-Reply-To: <45F5E1F9.5090806@elischer.org> References: <200703092241.l29Mf2Ds062856@repoman.freebsd.org> <200703121535.22140.jhb@freebsd.org> <20070312200345.GB5688@garage.freebsd.pl> <200703121618.41084.jhb@freebsd.org> <45F5E1F9.5090806@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070313010309.Q25395>