qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [newbie] main_loop_wait & os_host_main_loop_wait unders


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [newbie] main_loop_wait & os_host_main_loop_wait understanding
Date: Thu, 12 Mar 2015 13:26:54 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Mar 10, 2015 at 12:48:08PM +0100, telecolega . wrote:
> I am trying to understand the code of QEMU and one of the things which
> is unclear to me is what are the purposes of the loops:
> main_loop_wait() and os_host_main_loop_wait(). They both look similar
> since they prepare fds, poll them and dispatch them but I assume they
> process different fds (otherwise, why there would be two different
> loops?).

main_loop_wait() is QEMU's main event loop.

os_host_main_loop_wait() is the host OS-specific implementation of event
waiting code.  This function is not a loop, it just waits for a given
time duration - i.e. a single iteration of the main_loop_wait() loop.

main_loop_wait() is portable code, os_host_main_loop_wait() is host
OS-specific (there is a POSIX and a Windows implementation).

So the split between these two functions is largely for sharing the
portable main_loop_wait() logic.

Stefan

Attachment: pgpbJ9IX7m2Lq.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]