On 03/08/2018 17:49, Fam Zheng wrote: > void aio_notify_accept(AioContext *ctx) > { > - if (atomic_xchg(&ctx->notified, false)) { > + /* If ctx->notify_me >= 2, another aio_poll() is waiting which may need > the > + * ctx->notifier event to wake up, so don't already clear it just > because "we" are > + * done iterating. */ > + if (atomic_read(&ctx->notify_me) < 2 > + && atomic_xchg(&ctx->notified, false)) { > event_notifier_test_and_clear(&ctx->notifier); > } > }
I'm worried that this would this cause a busy wait, and I don't understand the issue. When aio_poll()s are nested, outer calls are in the "dispatch" phase and therefore do not need notification. In your situation is notify_me actually ever >2? Paolo