qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH] Fix freezing bug in curses console


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] Re: [PATCH] Fix freezing bug in curses console
Date: Sun, 1 Mar 2009 11:36:35 +0000
User-agent: Mutt/1.4.1i

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 :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]