From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LdjyM-0006Og-1e for qemu-devel@nongnu.org; Sun, 01 Mar 2009 06:36:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LdjyL-0006OL-50 for qemu-devel@nongnu.org; Sun, 01 Mar 2009 06:36:41 -0500 Received: from [199.232.76.173] (port=42889 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LdjyL-0006OG-25 for qemu-devel@nongnu.org; Sun, 01 Mar 2009 06:36:41 -0500 Received: from mx1.redhat.com ([66.187.233.31]:36753) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LdjyK-0000JM-P4 for qemu-devel@nongnu.org; Sun, 01 Mar 2009 06:36:40 -0500 Date: Sun, 1 Mar 2009 11:36:35 +0000 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] Re: [PATCH] Fix freezing bug in curses console Message-ID: <20090301113635.GA10538@redhat.com> References: <49A843CA.2050500@us.ibm.com> <49A85541.7040805@codemonkey.ws> <20090228212116.GL20640@shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090228212116.GL20640@shareable.org> Reply-To: "Daniel P. Berrange" , 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: Matthew Bloch , kvm@vger.kernel.org On Sat, Feb 28, 2009 at 09:21:16PM +0000, Jamie Lokier wrote: > Anthony Liguori wrote: > > >>It's racy with select(). A better fix would be to create a pipe and write > > >>to that pipe in the SIGWINCH handler. You should then register an io > > >> > > > > > >Maybe a bottom half would work? The scheduling of a bh shouldn't > > >constitute "real work". > > > > I think it still suffers from the same race condition so today it > > wouldn't work. You could fix the bottom half scheduling though so that > > you could safely schedule a bottom half from a signal handler (using > > roughly the same trick). > > Fwiw, it's perfectly sensible to have a single pipe which is shared by > all signal handlers, just used to say "check for work flags set". And if you need the main loop to be able to distinguish signals coming out of the pipe, then just write the signum into the pipe as a byte, instead of a single dummy byte. Or even write the whole 'siginfo_t' struct passed to the signal handler, and read it out in sizeof(siginfo_t) sized chunks for processing. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|