From owner-freebsd-current@FreeBSD.ORG Sat Oct 10 05:25:18 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 834C81065676 for ; Sat, 10 Oct 2009 05:25:18 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6F28E8FC13; Sat, 10 Oct 2009 05:25:18 +0000 (UTC) Received: from apple.my.domain (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n9A5PGVa033418; Sat, 10 Oct 2009 05:25:17 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4AD01ABC.50901@freebsd.org> Date: Sat, 10 Oct 2009 13:25:16 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: Kostik Belousov References: <20091001120730.GR3130@deviant.kiev.zoral.com.ua> <20091002201213.GA16633@stack.nl> <20091005192144.GA2259@deviant.kiev.zoral.com.ua> In-Reply-To: <20091005192144.GA2259@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, Jilles Tjoelker , Justin Teller Subject: Re: Signals and an exiting thread X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 10 Oct 2009 05:25:18 -0000 Kostik Belousov wrote: > I agree that postponing assignment of the thread for signal delivery > till the actual delivery occurs is the proper fix. I tried to cheat > in my previous patch. Below is an experimental change that did very > minimal testing. > Even if the signal is put into process's signal queue, it is still possible that signal notification is lost because selected thread exits before seeing it, if other threads are sleeping, they are not notified, this leaves signal in process queue long time before it can be delivered to userland.