From owner-freebsd-current Sat Dec 19 15:14:49 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA00500 for freebsd-current-outgoing; Sat, 19 Dec 1998 15:14:49 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA00493 for ; Sat, 19 Dec 1998 15:14:41 -0800 (PST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.1/8.9.1) id SAA11196; Sat, 19 Dec 1998 18:14:23 -0500 (EST) (envelope-from wollman) Date: Sat, 19 Dec 1998 18:14:23 -0500 (EST) From: Garrett Wollman Message-Id: <199812192314.SAA11196@khavrinen.lcs.mit.edu> To: Archie Cobbs Cc: dillon@apollo.backplane.com (Matthew Dillon), freebsd-current@FreeBSD.ORG, jkh@zippy.cdrom.com, julian@whistle.com, luoqi@watermarkgroup.com Subject: Re: asleep()/await(), M_AWAIT, etc... In-Reply-To: <199812192303.PAA03836@bubba.whistle.com> References: <199812192111.NAA20772@apollo.backplane.com> <199812192303.PAA03836@bubba.whistle.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG < said: > Also, this kind of thing must be very well documented in the code, > e.g., at the points in the code that are calling await(). > Otherwise, people changing the code later on could inadvertently > add race conditions, etc. based on assumptions that are obsolete. While we're talking about frobbing tsleep and friends, I'd really like to see an implementation of thread-assist. This should be a fairly easy hack: When tsleep is called, if a process flag is set, automatically rfork() the process. Put the running fork on the sleep queue, and return into the new process with an error indication and ETHREADBLOCKED. What the thread kernel would then be expected to do is to invoke the scheduler to find a new thread to run, and set a flag on the old process indicating that it should be destroyed (and its context moved to another process) when the system call does return. This would require one additional system call. -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, CRS, or NSA| - Susan Aglukark and Chad Irschick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message