Hi
On Wed, Jan 4, 2017 at 10:23 PM Paolo Bonzini <[email protected]> wrote:
>
> > Paolo suggested to me on irc to call event_notifier_test_and_clear()
> > after select() >0 from aio-win32.c's aio_prepare. Unfortunately, not all
> > fds associated with ctx->notifiers are in AIO fd handlers set.
> > (qemu_set_nonblock() in util/oslib-win32.c calls qemu_fd_register()).
>
> That makes sense. Out of curiosity, what is a practical case of a socket
> that is nonblocking but doesn't have an attached handler?
>
>
Good question, qio_channel_socket_set_blocking() calls qemu_set_nonblock().
But it seems to also use its own source handler
qio_channel_create_socket_watch(), so the AIO notifier is probably needless
here.
Another possibility (this one requires much more attention to avoid missing
> some edge case; however, it should be easy to verify if it fixes the busy
> loop) could be to move aio_notify_accept to just before setting
> ctx->notify_me.
> This would work for both aio-posix and aio-win32.
>
>
--- a/async.c
+++ b/async.c
@@ -232,8 +232,8 @@ aio_ctx_check(GSource *source)
AioContext *ctx = (AioContext *) source;
QEMUBH *bh;
- atomic_and(&ctx->notify_me, ~1);
aio_notify_accept(ctx);
+ atomic_and(&ctx->notify_me, ~1);
That? doesn't work here.
thanks
--
Marc-André Lureau