From owner-freebsd-current Sat Dec 19 12:15:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA12760 for freebsd-current-outgoing; Sat, 19 Dec 1998 12:15:04 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA12755 for ; Sat, 19 Dec 1998 12:15:02 -0800 (PST) (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id MAA20947; Sat, 19 Dec 1998 12:00:40 -0800 (PST) Received: from bubba.whistle.com( 207.76.205.7) by whistle.com via smap (V2.0) id xma020943; Sat, 19 Dec 98 12:00:37 -0800 Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id MAA01212; Sat, 19 Dec 1998 12:00:36 -0800 (PST) From: Archie Cobbs Message-Id: <199812192000.MAA01212@bubba.whistle.com> Subject: Re: asleep()/await(), M_AWAIT, etc... In-Reply-To: <199812191005.CAA07224@apollo.backplane.com> from Matthew Dillon at "Dec 19, 98 02:05:54 am" To: dillon@apollo.backplane.com (Matthew Dillon) Date: Sat, 19 Dec 1998 12:00:36 -0800 (PST) Cc: freebsd-current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Matthew Dillon writes: > :> We add an asleep() kernel function to complement tsleep(). asleep() > :> works like tsleep() in that it adds the process to the appropriate > :> slpque, but asleep() does *not* put the process to sleep. Instead it > :> returns immediately. The process stays runnable. Additional calls > :> to asleep() (or a call to tsleep()) removes the proc from any slpque > :> and re-adds it to the new one. i.e. only the most recent call is > :> effective. > :> > :> We add an await() kernel function. This function initiates any timeout > :> and puts the process to sleep, but only if it is still on a sleep queue. > :> If someone (i.e. an interrupt) wakes up the sleep address after the > :> process calls asleep() but before it calls await(), the slpque is > :> cleared and the await() winds up being a NOP. > : > :Hmm.. sounds interesting. Seems like one problem is that most > :function calls have the semantics that they don't return until > :the job they are supposed to do is finished. This would change. > > It's something we could work on from the bottom-up. We > would not have to change everything at once. For example, giving Well, since the amount of code to implement it is not that much, and it allows beneficial changes to be made incrementally and as appropriate, I don't see any reason why it shouldn't be added. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message