All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: Matthew Bloch <matthew@bytemark.co.uk>, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] Re: [PATCH] Fix freezing bug in curses console
Date: Sun, 1 Mar 2009 11:36:35 +0000	[thread overview]
Message-ID: <20090301113635.GA10538@redhat.com> (raw)
In-Reply-To: <20090228212116.GL20640@shareable.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 :|

  reply	other threads:[~2009-03-01 11:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21 15:51 [PATCH] Fix freezing bug in curses console Matthew Bloch
2009-01-21 15:51 ` [Qemu-devel] " Matthew Bloch
2009-02-27 19:49 ` Anthony Liguori
2009-02-27 19:49   ` [Qemu-devel] " Anthony Liguori
2009-02-27 21:01   ` andrzej zaborowski
2009-02-27 21:04     ` Anthony Liguori
2009-02-27 21:04       ` Anthony Liguori
2009-02-28 21:21       ` Jamie Lokier
2009-02-28 21:21         ` Jamie Lokier
2009-03-01 11:36         ` Daniel P. Berrange [this message]
2009-03-01 13:03           ` Paul Brook
2009-03-01 14:07             ` Anthony Liguori
2009-03-01 14:07               ` Anthony Liguori
2009-03-02 16:57               ` Jamie Lokier
2009-03-02 16:57                 ` Jamie Lokier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090301113635.GA10538@redhat.com \
    --to=berrange@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=matthew@bytemark.co.uk \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.