From owner-freebsd-hackers Sun Nov 21 21:38: 4 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 7B4A914C92 for ; Sun, 21 Nov 1999 21:38:01 -0800 (PST) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id AAA01826; Mon, 22 Nov 1999 00:38:01 -0500 (EST) Date: Mon, 22 Nov 1999 00:38:01 -0500 (EST) From: Daniel Eischen Message-Id: <199911220538.AAA01826@pcnet1.pcnet.com> To: eischen@vigrid.com, freebsd-hackers@FreeBSD.ORG, scott@avantgo.com Subject: Re: EINTR problems with multithreaded programs. Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Scott Hess wrote: > I've checked further, and found that FreeBSD correctly handles blocking > signals on a per-thread basis. _But_, all threads still get EINTR when a > signal happens while they're in a blocking read. > > I've attached the updated program that shows the correct delivery of the > signals, with system calls still being interrupted. [Sorry about the > attachment, but that seems the safest way to go about getting the file > delivered in usable fashion.] Thanks for the test program; it makes it much easier on the developers. After consultation with the POSIX spec and John Birrell, it seems that FreeBSD is in error. Along with incorrectly waking up threads blocked on I/O, signals should _not_ be delivered to more than one thread - FreeBSD was delivering them to every thread that had the signal unmasked. I have a fix for this, but will sit on it for another day or so, until I can test it some more. Your test program now works as it should, BTW. Dan Eischen eischen@vigrid.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message