From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KY2fW-0007NY-2b for qemu-devel@nongnu.org; Tue, 26 Aug 2008 13:49:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KY2fU-0007Lh-6n for qemu-devel@nongnu.org; Tue, 26 Aug 2008 13:49:25 -0400 Received: from [199.232.76.173] (port=60707 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KY2fU-0007LQ-21 for qemu-devel@nongnu.org; Tue, 26 Aug 2008 13:49:24 -0400 Received: from mail2.shareable.org ([80.68.89.115]:43551) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KY2fT-00006V-G9 for qemu-devel@nongnu.org; Tue, 26 Aug 2008 13:49:23 -0400 Date: Tue, 26 Aug 2008 18:49:19 +0100 From: Jamie Lokier Subject: Re: [Xen-devel] Re: [Qemu-devel] [PATCH 01/13] Handle terminating signals. Message-ID: <20080826174919.GC25893@shareable.org> References: <1219336054-15919-1-git-send-email-kraxel@redhat.com> <1219336054-15919-2-git-send-email-kraxel@redhat.com> <18611.56975.584280.471257@mariner.uk.xensource.com> <48B3F411.2020306@redhat.com> <18611.63711.631859.280983@mariner.uk.xensource.com> <48B4027C.1000008@codemonkey.ws> <18612.1900.73781.314743@mariner.uk.xensource.com> <48B4189E.80807@qumranet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48B4189E.80807@qumranet.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: xen-devel@lists.xensource.com, Gerd Hoffmann Avi Kivity wrote: > Ian Jackson wrote: > >>In KVM, we sleep for 1s in select() and use signalfd() to receive the > >>aio notifications. For older hosts, we emulate signalfd using a thread > >>and the pipe-to-self trick. > >> > > > >Why does it need a thread ? You can just write to the pipe in the > >signal handler. I'll post my code. > > > > Not sure that it matters, but the semantics are slightly different: > with a thread you don't get EINTR in random syscalls as the signal > thread is the only one that has the signals unblocked. You shouldn't be getting spurious EINTRs if the signal handlers are registered with SA_RESTART. I doubt if any useful host which has threads does not have SA_RESTART. -- Jamie