[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/16] iothread: release AioContext around aio_p
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 05/16] iothread: release AioContext around aio_poll |
Date: |
Wed, 3 Feb 2016 09:34:44 +0000 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Tue, Feb 02, 2016 at 04:01:55PM +0100, Paolo Bonzini wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
>
>
> On 02/02/2016 15:52, Stefan Hajnoczi wrote:
> >>> @@ -110,6 +111,8 @@ static void *test_acquire_thread(void
> >>> *opaque) qemu_mutex_lock(&data->start_lock);
> >>> qemu_mutex_unlock(&data->start_lock);
> >>>
> >>> + g_usleep(500000);
> > Sleep?
>
> What about it? :)
Sleep in a loop is inefficient but at least correct.
A sleep outside a loop is a race condition. If the machine is heavily
loaded, whatever you are waiting for may not happen in 500 ms and the
test case is unreliable.
What is the purpose of this sleep?
Stefan
signature.asc
Description: PGP signature