From owner-cvs-src@FreeBSD.ORG Mon Mar 5 15:31:59 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 D740B16A494; Mon, 5 Mar 2007 15:31:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 5B03013C4B3; Mon, 5 Mar 2007 15:31:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l25FVrPN002893; Mon, 5 Mar 2007 10:31:54 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Robert Watson Date: Mon, 5 Mar 2007 10:32:19 -0500 User-Agent: KMail/1.9.1 References: <200703042342.l24Ngwmu040217@repoman.freebsd.org> <20070305092518.F44433@fledge.watson.org> In-Reply-To: <20070305092518.F44433@fledge.watson.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200703051032.20618.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 05 Mar 2007 10:31:54 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2732/Mon Mar 5 09:05:12 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Greg Lehey , cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/share/man/man9 sleep.9 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: Mon, 05 Mar 2007 15:32:00 -0000 On Monday 05 March 2007 04:36, Robert Watson wrote: > > On Sun, 4 Mar 2007, Greg Lehey wrote: > > > grog 2007-03-04 23:42:58 UTC > > > > FreeBSD src repository > > > > Modified files: > > share/man/man9 sleep.9 > > Log: > > Rearrange function descriptions in more logical order. > > Be less alarmist about the dangers of abusing wakeup_one(). > > How would you feel about language along the lines of: > > Prior to the introduction of wakeup_one(), using a single wait channel > address was possible as long as all sleepers looped around the sleep call > re-checking the condition after each wakeup. However, with the addition of > wakeup_one(), combining wait channels for multiple purposes may lead easily > to bugs involving lost wakeups, and is strongly discouraged. It is > recommended that consumers of the sleep(9) programming interface carefully > follow the convention of using only wait channels associated with memory > addresses explicitly allocated for this purpose, and not overload or extend > the semantics of existing wait channels without careful analysis in order to > avoid potential channel collisions. Programmers may find the cv(9) > interface easier to use correctly, as it has explicit condition variable > data structures. > > That way we combine warnings about potential misuse with a recommendation for > the cv(9) API. How about a far simpler sentence: Programmers should ensure that wait channels are not used for multiple events. Unless there is wide misunderstanding of this concept (which there doesn't seem to be judging from the followups) we shouldn't spend any more length on the topic than that. -- John Baldwin