[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] AioContext: acquire/release AioContext duri
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] AioContext: acquire/release AioContext during aio_poll |
Date: |
Wed, 8 Jul 2015 09:52:23 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 |
On 08/07/2015 04:18, Fam Zheng wrote:
>> > @@ -267,7 +268,13 @@ bool aio_poll(AioContext *ctx, bool blocking)
>> > timeout = blocking ? aio_compute_timeout(ctx) : 0;
>> >
>> > /* wait until next event */
>> > + if (timeout) {
>> > + aio_context_release(ctx);
>> > + }
>> > ret = qemu_poll_ns((GPollFD *)pollfds, npfd, timeout);
> If two threads poll concurrently on this ctx, they will get the same set of
> events, is that safe? Doesn't that lead to double dispatch?
Yes, but handlers should be okay with spurious wakeup. They will just
get EAGAIN.
Paolo