Received: from eggs.gnu.org ([2001:4830:134:3::10]:54307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0T4H-0006v8-Fk for qemu-devel@nongnu.org; Fri, 27 Jun 2014 06:07:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0T4B-00083a-BI for qemu-devel@nongnu.org; Fri, 27 Jun 2014 06:07:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55561) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0T4B-00083R-2u for qemu-devel@nongnu.org; Fri, 27 Jun 2014 06:07:35 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5RA7YGV001129 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 27 Jun 2014 06:07:34 -0400 Date: Fri, 27 Jun 2014 12:07:32 +0200 From: Stefan Hajnoczi Message-ID: <20140627100732.GJ12061@stefanha-thinkpad.muc.redhat.com> References: <1402322375-18899-1-git-send-email-stefanha@redhat.com> <5395C091.5010701@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="451BZW+OUuJBCAYj" Content-Disposition: inline In-Reply-To: <5395C091.5010701@redhat.com> Subject: Re: [Qemu-devel] [PATCH] docs/multiple-iothreads.txt: add documentation on IOThread programming List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Fam Zheng , qemu-devel@nongnu.org --451BZW+OUuJBCAYj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 usin= g 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=3Dmy-iothread. > >+ > >+Side note: The main loop and IOThread are both event loops but their co= de is > >+not shared completely. Sometimes it is useful to remember that althoug= h they > >+are conceptually similar they are currently not interchangeable. >=20 > 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 >=20 > also seems to be unused except for qemu-io-cmds.c (and easily removed from > there). >=20 > Perhaps add a note (here or elsewhere) that timer_new_ms/qemu_bh_new shou= ld > never be used in the block layer? I'll note it further down where the block layer is mentioned. --451BZW+OUuJBCAYj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTrUJkAAoJEJykq7OBq3PIZfwIALWx1RGUu7r0J9Aev8UIA4Go Jck4b94Sxwbj9+t+uazpmD0XgmOz+YdNxW5pTAOTCJRd3sX0TgOuJG8YKstehYCO QSrlt+iTAlemjEPhYtN98TrZQsLILPOgqQkUukrnktDflGTF2cQkw6QAyb2Tu13q i5sJS+vSRjGrtfJ1V5ePhtqN3ZQMVqXN3FSH4k6s6n/XAshvUrRhWvcoUKfHWl2J xGm0ArMtDzRra/U2ny1HcZIBiwZTvnBPDVWEENoPrdCr4rnWvXPZsiGHnzkqfC5X XFgunlJkZrTFrfAsuI0n7kIfDGaXqUhuquiyT5WmvuNuR5NvLYhrfTQ+cdwdNic= =AqPj -----END PGP SIGNATURE----- --451BZW+OUuJBCAYj--