qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread"
Date: Thu, 8 Oct 2009 23:24:21 +0200
User-agent: Mutt/1.5.19 (2009-01-05)

On Thu, Oct 08, 2009 at 04:15:27PM +0100, Jamie Lokier wrote:
> malc wrote:
> > On Thu, 8 Oct 2009, Jamie Lokier wrote:
> > 
> > > malc wrote:
> > > > >       The  use of sigprocmask() is unspecified in a
> > > > >       multithreaded process; see pthread_sigmask(3).
> > > > > 
> > > > > Does it matter?
> > > > 
> > > > One of the patches i've asked you to try today replaced sigprocmask with
> > > > pthread_sigmask, you've said it did nothing. In any case, strictly
> > > > speaking, the code is wrong, so yes it does matter in theory.

BTW, tried looking at the code.
I saw some (unrelated) issues:

static void aio_signal_handler(int signum)
{
    if (posix_aio_state) {
        char byte = 0;

        write(posix_aio_state->wfd, &byte, sizeof(byte));
    }

    qemu_service_io();
}

And qemu_service_io does a *ton* of things.
Questions:
-  Do we need the call to qemu_service_io? Seems to
   behave the same with and without it.
-  Are all of the data structures touched by qemu_service_io
   protected by blocking signals before access?

Also:
        - let's use signalfd on linux, if available?
        - for SIGALARM, maybe timerfd?

Thanks,

-- 
MST




reply via email to

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