qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] [PATCHv10 00/31] aio / timers: Add AioContext tim


From: Alex Bligh
Subject: Re: [Qemu-devel] [RFC] [PATCHv10 00/31] aio / timers: Add AioContext timers and use ppoll
Date: Tue, 13 Aug 2013 14:12:30 +0100

On 13 Aug 2013, at 13:22, Jan Kiszka wrote:

> Another trick necessary to make this work is the following:
> 
> static int rtc_aio_flush_true(EventNotifier *e)
> {
>    return 1;
> }
> 
> ...
>    s->aio_ctx = aio_context_new();
>    aio_set_event_notifier(s->aio_ctx, &s->aio_ctx->notifier,
>                           (EventNotifierHandler *)
>                           event_notifier_test_and_clear,
>                           rtc_aio_flush_true);
> 
> ie. enable blocking of aio_poll via the only i/o channel a timer thread
> has: the event notifier.


Personally I think this is a straightforward bug in aio_poll. I think
it should block if it has no fds to listen to until the next timer
occurs. People who call it with no fds and no timers deserve all they
get. But as you've just proved, this is useful (for instance when
another thread can add timers).

I think stefanha disagrees this is a bug though :-)

-- 
Alex Bligh







reply via email to

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