On Mon, 07/20 07:27, Paolo Bonzini wrote:
> diff --git a/aio-win32.c b/aio-win32.c
> index ea655b0..7afc999 100644
> --- a/aio-win32.c
> +++ b/aio-win32.c
> @@ -337,10 +337,11 @@ bool aio_poll(AioContext *ctx, bool blocking)
>              aio_context_acquire(ctx);
>          }
>  
> -        if (first && aio_bh_poll(ctx)) {
> -            progress = true;
> +        if (first) {
> +            event_notifier_test_and_clear(&ctx->notifier);

I'm looking at optimizing it but I don't fully understand the relationship
between aio_prepare and WaitForMultipleObjects. Do they get the same set of
events? What if a new event comes in between, for example, thread worker calls
aio_notify()?

Fam

> +            progress |= aio_bh_poll(ctx);
> +            first = false;
>          }
> -        first = false;
>  
>          /* if we have any signaled events, dispatch event */
>          event = NULL;

Reply via email to