From owner-freebsd-current Tue Aug 15 19:28: 8 2000 Delivered-To: freebsd-current@freebsd.org Received: from alcanet.com.au (mail.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (Postfix) with SMTP id DA8DC37B8A7 for ; Wed, 16 Aug 2000 02:28:04 +0000 (GMT) (envelope-from jeremyp@gsmx07.alcatel.com.au) Received: by border.alcanet.com.au id <115238>; Wed, 16 Aug 2000 12:28:02 +1000 Content-return: prohibited Date: Wed, 16 Aug 2000 12:27:56 +1000 From: Peter Jeremy Subject: Re: Ugly, slow shutdown In-reply-to: <200008072149.OAA04253@implode.root.com>; from dg@root.com on Mon, Aug 07, 2000 at 02:49:34PM -0700 To: David Greenman Cc: freebsd-current@FreeBSD.ORG Mail-followup-to: David Greenman , freebsd-current@FreeBSD.ORG Message-Id: <00Aug16.122802est.115238@border.alcanet.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.4i References: <398F3089.416DEA1@originative.co.uk> <200008072149.OAA04253@implode.root.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 2000-Aug-07 14:49:34 -0700, David Greenman wrote: > No, that's not true, and there are many examples in the kernel where a >bogus wakeup would lead to bad things happening. I recall some code in the >advisory locking code, and VM system, that assume that there is only one >wakeup event and that the thing causing it assures that certain other >things have occured before issuing it. That's just the way it has worked >since the dawn of time. In the beginning, there was sleep(). The V6, V7, 2.9BSD and 2.11BSD [which is all I've checked] sources all include the following comment on sleep(): * Callers of this routine must be prepared for * premature return, and check that the reason for * sleeping has gone away. 2.9BSD tsleep() is implemented using sleep() and it's not immediately obvious that tsleep() won't also return prematurely. In 2.11BSD, sleep() is implemented using a tsleep() `"borrowed" from 4.4BSD'. Presumably a conscious decision was made to change the semantics between sleep() and tsleep(). Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message