[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/16] io: make qio_channel_yield aware of AioCo
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 05/16] io: make qio_channel_yield aware of AioContexts |
Date: |
Mon, 16 Jan 2017 15:18:36 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
On 16/01/2017 13:58, Daniel P. Berrange wrote:
>> + * Request that qio_channel_yield() sets I/O handlers on
>> + * the given #AioContext. If @ctx is %NULL, qio_channel_yield()
>> + * uses QEMU's main thread event loop.
>> + */
> Can you note that it is explicitly permitted to call this while
> inside a qio_channel_yield().
Yes:
* You can move a #QIOChannel from an #AioContext to another even if
* I/O handlers are set for a coroutine. However, #QIOChannel provides
* no synchronization between the calls to qio_channel_yield() and
* qio_channel_set_aio_context().
*
* Therefore you should first call qio_channel_detach_aio_context()
* to ensure that the coroutine is not entered concurrently. Then,
* while the coroutine has yielded, call qio_channel_set_aio_context(),
* and then aio_co_schedule() to place the coroutine on the new
* #AioContext. The calls to qio_channel_detach_aio_context()
* and qio_channel_set_aio_context() should be protected with
* aio_context_acquire() and aio_context_release().
Paolo
- [Qemu-devel] [PATCH 03/16] test-thread-pool: use generic AioContext infrastructure, (continued)
Re: [Qemu-devel] [PATCH 05/16] io: make qio_channel_yield aware of AioContexts, Daniel P. Berrange, 2017/01/16
- Re: [Qemu-devel] [PATCH 05/16] io: make qio_channel_yield aware of AioContexts,
Paolo Bonzini <=
Re: [Qemu-devel] [PATCH 05/16] io: make qio_channel_yield aware of AioContexts, Stefan Hajnoczi, 2017/01/18
[Qemu-devel] [PATCH 04/16] io: add methods to set I/O handlers on AioContext, Paolo Bonzini, 2017/01/13
[Qemu-devel] [PATCH 07/16] coroutine-lock: reschedule coroutine on the AioContext it was running on, Paolo Bonzini, 2017/01/13