From owner-freebsd-current@FreeBSD.ORG Wed Apr 2 13:25:20 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C60D37B407; Wed, 2 Apr 2003 13:25:20 -0800 (PST) Received: from sccrmhc02.attbi.com (sccrmhc02.attbi.com [204.127.202.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3F8843FAF; Wed, 2 Apr 2003 13:25:18 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc02.attbi.com (sccrmhc02) with ESMTP id <2003040221251700200774mke>; Wed, 2 Apr 2003 21:25:18 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA18095; Wed, 2 Apr 2003 13:25:16 -0800 (PST) Date: Wed, 2 Apr 2003 13:25:15 -0800 (PST) From: Julian Elischer To: Jeff Roberson In-Reply-To: <20030402154406.N64602-100000@mail.chesapeake.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Alexander Leidinger cc: Robert Watson cc: csujun@21cn.com cc: current@freebsd.org Subject: Re: libthr and 1:1 threading. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2003 21:25:20 -0000 On Wed, 2 Apr 2003, Jeff Roberson wrote: > On Wed, 2 Apr 2003, Juli Mallett wrote: > > > * De: Jeff Roberson [ Data: 2003-04-02 ] > > [ Subjecte: Re: libthr and 1:1 threading. ] > > > On Wed, 2 Apr 2003, Terry Lambert wrote: > > > > Also, any ETA on the per process signal mask handing bug in > > > > libthr? Might not be safe to convert everything up front, in > > > > a rush of eager enthusiasm... > > > > > > Which bug is that? I'm not aware of it. > > > > I think Terry is referring to the Uncertainty & Doubt as if it were > > a bug over the lack of a process sigmask (moved into the threads), > > as raised by the M:N group. > > POSIX specifically says that the signal mask is per thread. I'd be very > surprised if the 1:1 sigmask/sigpending stuff was wrong. I don't think > signal handling in M:N has really been totally worked out. Their concerns > were more like 'how do we do this given the new signal restructuring' > > Perhaps I should start quoting posix. I wonder what my legal rights > are given the copyright. hm.. Posix defines the interface at the 'top' of the library. In M:N threads, the process gets signals that are not blocked by any thread. There may be 10,000 threads, only 3 of which the kernel has any knowledge. The signal needs to be checked againsta a per-process mask before being routed to the UTS for forwarding to the apropriate thread. To achieve that efficiently we will have a per-process mask, and use that. 1:1 threads (and non-threaded processes) will continue to use the per-thread mask. On switching to M:N mode, we'll just clone the active thread's mask into the process mask. No biggie.. just needs code :-) When M:N threads are involved psignal() will just check against a different mask, and delivery is already handled in a different manner. The UTS will update the per-process mask as needed as only it knows what all the threads are masking (since the kernel doesn't even know what threads exist).