Date: Fri, 29 Sep 2000 16:04:15 -0400 (EDT) From: Daniel Eischen <eischen@vigrid.com> To: Alfred Perlstein <bright@wintelcom.net> Cc: Roman Shterenzon <roman@harmonic.co.il>, freebsd-stable@FreeBSD.ORG Subject: Re: pthreads bug? Message-ID: <Pine.SUN.3.91.1000929154925.18590A-100000@pcnet1.pcnet.com> In-Reply-To: <20000929103756.I27736@fw.wintelcom.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 29 Sep 2000, Alfred Perlstein wrote: > * Daniel Eischen <eischen@vigrid.com> [000929 04:29] wrote: > > > > I don't think it should be fixed unless we decide to remove the > > automatic locking of file descriptors. But if you do come up > > with a clean solution, please run it by me. I have some massive > > changes to the threads library that are currently under review. > > Well the hackish idea that I had was to set the thread runnable > but somehow set a flag so that it knows it's the "accept() being > broken by close() wakeup." The accept()ing thread can then unlock > the file and return EBADF or whatever it's supposed to. Probably better to handle the file descriptor being closed/removed out from under the thread in all the wrapped IO calls (read, write, send, recv, etc) in a general way, as opposed to limiting it to just accept(). A more general solution would be to set the thread runnable (like you suggested), set the interrupted flag (already present), and also set the errno appropriately. Right now, the interrupted thread sets errno itself, as opposed to relying on it being set by the waker/signaler. We'd have to go through and change this in all the wrapped IO calls as well as the places where the threads are awoken. -- Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.1000929154925.18590A-100000>