[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Question about aio_poll and glib aio_ctx_dispatch
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] Question about aio_poll and glib aio_ctx_dispatch |
Date: |
Wed, 19 Dec 2018 21:41:53 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
On 19/12/18 11:05, Li Qiang wrote:
> Sent it to qemu-devel.
>
> Li Qiang <address@hidden <mailto:address@hidden>> 于2018年12月19日周
> 三 下午6:04写道:
>
> Hello Paolo, Stefan, Fam and all,
>
> Here I have a question about 'aio_poll'.
> IIUC the 'aio_poll' is (mostly) used for synchronous IO
> as I see a lot of code like this:
> while(condition)
> aio_poll();
>
> However it seems the 'aio_poll' and 'aio_ctx_dispatch' both poll the fd.
> So what happened when the 'fd' has events, which function will be
> wakeup?
Roughly speaking, aio_poll is used for synchronous IO and within I/O
threads; aio_ctx_dispatch is used within the main thread.
Both end up calling aio_dispatch_handlers and timerlistgroup_run_timers.
Paolo