From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMCeG-0006qZ-MP for qemu-devel@nongnu.org; Thu, 21 Jan 2016 05:39:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMCeB-0004Xr-Ma for qemu-devel@nongnu.org; Thu, 21 Jan 2016 05:39:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMCeB-0004Xg-Go for qemu-devel@nongnu.org; Thu, 21 Jan 2016 05:39:23 -0500 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 (Postfix) with ESMTPS id 055913B75A for ; Thu, 21 Jan 2016 10:39:23 +0000 (UTC) Message-ID: <1453372760.11655.69.camel@redhat.com> From: Gerd Hoffmann Date: Thu, 21 Jan 2016 11:39:20 +0100 In-Reply-To: <20160121095811.GA3671@stefanha-x1.localdomain> References: <1453110880.23289.7.camel@redhat.com> <20160119125109.GA4579@noname.redhat.com> <20160121095811.GA3671@stefanha-x1.localdomain> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] RFC: running the user interface in a thread ... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , David Airlie , =?ISO-8859-1?Q?Marc-Andr=E9?= Lureau , qemu-devel Hi, > That sounds good in theory (but see below) since AioContext integrates > with the glib main loop because it is a GSource. QEMU code should use > AioContext where we have high resolution timers and APIs for file > descriptor, EventNotifier, and BH. Sounds good. > Use BH or EventNotifier instead. BH has optimizations to avoid syscalls > where possible while EventNotifier is just a plain eventfd/pipe > (requires a write() syscall for each notification). How does BH signaling work? I know I can qemu_bh_schedule from !main thread to kick BH in main thread context. The other way around works using aio_bh_new + aio_bh_call I guess? thanks, Gerd