From owner-cvs-src@FreeBSD.ORG Tue Mar 13 00:05:00 2007 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC64916A402; Tue, 13 Mar 2007 00:05:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6C7B713C44C; Tue, 13 Mar 2007 00:05:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id A0A9946BF2; Mon, 12 Mar 2007 19:04:58 -0500 (EST) Date: Tue, 13 Mar 2007 01:04:58 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Julian Elischer In-Reply-To: <45F5E1F9.5090806@elischer.org> Message-ID: <20070313010309.Q25395@fledge.watson.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> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , cvs-src@freebsd.org, cvs-all@freebsd.org, Attilio Rao 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 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2007 00:05:01 -0000 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