qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] docs/multiple-iothreads.txt: add documentation


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] docs/multiple-iothreads.txt: add documentation on IOThread programming
Date: Fri, 27 Jun 2014 12:07:32 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jun 09, 2014 at 04:11:29PM +0200, Paolo Bonzini wrote:
> >+The main loop and IOThreads
> >+---------------------------
> >+QEMU is an event-driven program that can do several things at once using an
> >+event loop.  The VNC server and the QMP monitor are both processed from the
> >+same event loop which monitors their file descriptors until they become
> >+readable and then invokes a callback.
> >+
> >+The default event loop is called the main loop (see main-loop.c).  It is
> >+possible to create additional event loop threads using -object
> >+iothread,id=my-iothread.
> >+
> >+Side note: The main loop and IOThread are both event loops but their code is
> >+not shared completely.  Sometimes it is useful to remember that although 
> >they
> >+are conceptually similar they are currently not interchangeable.
> 
> Actually, the main loop does include all the iothread code.  So you could
> say that the main loop is a superset of the iothread.

Not quite.  The main loop includes AioContext but it does not use
iothread.c (IOThread).

> >+ * LEGACY timer_new_ms() - create a timer
> >+ * LEGACY qemu_bh_new() - create a BH
> >+ * LEGACY qemu_aio_wait() - run an event loop iteration
> 
> also seems to be unused except for qemu-io-cmds.c (and easily removed from
> there).
> 
> Perhaps add a note (here or elsewhere) that timer_new_ms/qemu_bh_new should
> never be used in the block layer?

I'll note it further down where the block layer is mentioned.

Attachment: pgpwkCfCE78Yu.pgp
Description: PGP signature


reply via email to

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