From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiOE5-0002XS-4U for qemu-devel@nongnu.org; Thu, 08 May 2014 09:19:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiODw-0008Rl-2f for qemu-devel@nongnu.org; Thu, 08 May 2014 09:19:05 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:33700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiODv-0008Qp-Se for qemu-devel@nongnu.org; Thu, 08 May 2014 09:18:56 -0400 Received: by mail-wi0-f180.google.com with SMTP id hi2so3074620wib.7 for ; Thu, 08 May 2014 06:18:55 -0700 (PDT) Date: Thu, 8 May 2014 15:18:52 +0200 From: Stefan Hajnoczi Message-ID: <20140508131852.GA13226@stefanha-thinkpad.redhat.com> References: <20140508101655.GA7534@stefanha-thinkpad.redhat.com> <20140508130846.GC4034@noname.redhat.com> <536B8258.2020902@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <536B8258.2020902@redhat.com> Subject: Re: [Qemu-devel] [RFC] dataplane: IOThreads and writing dataplane-capable code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Fam Zheng , qemu-devel@nongnu.org, Stefan Hajnoczi , Max Reitz On Thu, May 08, 2014 at 03:10:48PM +0200, Paolo Bonzini wrote: > Il 08/05/2014 15:08, Kevin Wolf ha scritto: > >Am 08.05.2014 um 12:16 hat Stefan Hajnoczi geschrieben: > >>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. > > > >We need to be careful with the terminology. The choice made here, that > >the main loop thread is not an IOThread, is somewhat unfortunate, > >because traditionally, the "I/O thread" has been what the main loop > >thread is called (in contrast to vcpu threads). > > Note that the main loop thread could definitely be an IOThread, > since it has an AioContext and the IOThread is just a QOM veneer for > AioContext. It's just not done yet. Yes, it's definitely a goal to unify the event loop implementations in QEMU. The main loop is more than just an AioContext, it's a glib event loop. The AioContext is a custom event loop that can be added to a glib event loop (as a GSource) but also supports BHs and high-resolution timers. Stefan