|
From: | Paolo Bonzini |
Subject: | Re: [PATCH v3 06/33] util/async: aio_co_schedule(): support reschedule in same ctx |
Date: | Wed, 12 May 2021 08:56:40 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
On 16/04/21 10:08, Vladimir Sementsov-Ogievskiy wrote:
With the following patch we want to call wake coroutine from thread. And it doesn't work with aio_co_wake: Assume we have no iothreads. Assume we have a coroutine A, which waits in the yield point for external aio_co_wake(), and no progress can be done until it happen. Main thread is in blocking aio_poll() (for example, in blk_read()). Now, in a separate thread we do aio_co_wake(). It calls aio_co_enter(), which goes through last "else" branch and do aio_context_acquire(ctx).
I don't understand. Why doesn't aio_co_enter go through the ctx != qemu_get_current_aio_context() branch and just do aio_co_schedule? That was at least the idea behind aio_co_wake and aio_co_enter.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |