From owner-freebsd-stable Fri Sep 29 7:43:50 2000 Delivered-To: freebsd-stable@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id DB42237B424 for ; Fri, 29 Sep 2000 07:43:47 -0700 (PDT) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id KAA03733; Fri, 29 Sep 2000 10:43:28 -0400 (EDT) Date: Fri, 29 Sep 2000 10:43:28 -0400 (EDT) From: Daniel Eischen To: Roman Shterenzon Cc: freebsd-stable@freebsd.org Subject: Re: pthreads bug? In-Reply-To: <970233870.39d4980e3f303@webmail.harmonic.co.il> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 29 Sep 2000, Roman Shterenzon wrote: > Quoting Daniel Eischen : > > > > > 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