Date: Fri, 29 Sep 2000 10:43:28 -0400 (EDT) From: Daniel Eischen <eischen@vigrid.com> To: Roman Shterenzon <roman@harmonic.co.il> Cc: freebsd-stable@freebsd.org Subject: Re: pthreads bug? Message-ID: <Pine.SUN.3.91.1000929103800.2836A-100000@pcnet1.pcnet.com> In-Reply-To: <970233870.39d4980e3f303@webmail.harmonic.co.il>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 29 Sep 2000, Roman Shterenzon wrote: > Quoting Daniel Eischen <eischen@vigrid.com>: > > > > > but, in fact gets blocked in the close() function. > > > > Obviously it's waiting to acquire some lock. > > > > Does anyone have an idea? > > > > > > Yes, I have an idea and an idea how to fix it, I'm wondering what > > > the thread in accept() sees after this happens? > > > > 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. > > > I'm concerned about signal delivery as well. > It doesn't really work as expected. > Take the small source I attached to one of my mails, add pthread_kill > in the "routine" thread with parameter of "main" thread, and observe that > accept() doesn't break out at all. I don't the sample program. Can you please send it to me privately as plain text? Make sure the thread in accept doesn't have the signal masked. Also make sure the signal handler is installed with SA_RESTART = 0. Do not use signal(3) to install the signal handler as this will automatically restart system calls (signal(3) calls sigaction with sa_flags = SA_RESTART). sigaction(2) should be used in preference to signal(3). -- 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.1000929103800.2836A-100000>