From owner-freebsd-current@FreeBSD.ORG Sat Oct 10 13:39:39 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 906011065670 for ; Sat, 10 Oct 2009 13:39:39 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-gx0-f214.google.com (mail-gx0-f214.google.com [209.85.217.214]) by mx1.freebsd.org (Postfix) with ESMTP id 403908FC14 for ; Sat, 10 Oct 2009 13:39:38 +0000 (UTC) Received: by gxk6 with SMTP id 6so7150576gxk.13 for ; Sat, 10 Oct 2009 06:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=9XblpqN2ZU+vJh9lXIduEmmX61Kv9uvPD/UKgGLXo1Q=; b=bF2g+JEUxV2Z4LgB407AmeTsPMhstYfVxMNPHo7wIzxF8pCA037IxAIx7SBLH3oWCw 3prFY+9LgLO2twSpf10pmyayv+P6AIyKfI5X0K5Hyr0W7YSwrKQMcjyM6rfnAFZDuX19 4HXFubY2rAuldLJH63FQhUqzQcLBpHdKPrs2M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=eY3x7yH0NStxaugd+z0cTJ4ZA360dLu2kZnmxvwE/mgPALnY7RzDmTcgTyuK4Hneor Nm5YKjLJ62qtQHKaekfkSnvbi7LbF2QJphBvzIx/DYGsbaiRwKNGa68h7JmMhe+/lGOM xpxBegDJdL4g2P36mhGOOvh0//XvtrlrCn1GI= MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.101.27.20 with SMTP id e20mr4327413anj.137.1255181978349; Sat, 10 Oct 2009 06:39:38 -0700 (PDT) In-Reply-To: References: <20091001120730.GR3130@deviant.kiev.zoral.com.ua> <20091002201213.GA16633@stack.nl> <20091005192144.GA2259@deviant.kiev.zoral.com.ua> <4AD01ABC.50901@freebsd.org> Date: Sat, 10 Oct 2009 09:39:38 -0400 X-Google-Sender-Auth: 1b54e50fb9f2a115 Message-ID: From: Justin Hibbits To: FreeBSD Current Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Fwd: 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 13:39:39 -0000 I really need to change gmail to reply to all by default. ---------- Forwarded message ---------- From: Justin Hibbits Date: Sat, Oct 10, 2009 at 9:38 AM Subject: Re: Signals and an exiting thread To: David Xu On Sat, Oct 10, 2009 at 1:25 AM, David Xu wrote: > 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. Unless they're in an uninterruptible sleep, wouldn't they be woken when the signal is processed? It might need work to give a second pass over the threads after one dies, but I think that could be done when handling the next task schedule. - Justin