From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RU1Ze-0003BM-J2 for qemu-devel@nongnu.org; Fri, 25 Nov 2011 14:36:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RU1Zd-0004i0-IK for qemu-devel@nongnu.org; Fri, 25 Nov 2011 14:36:38 -0500 Received: from mail-bw0-f45.google.com ([209.85.214.45]:51775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RU1Zd-0004ho-75 for qemu-devel@nongnu.org; Fri, 25 Nov 2011 14:36:37 -0500 Received: by bkbzu5 with SMTP id zu5so5309457bkb.4 for ; Fri, 25 Nov 2011 11:36:35 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4ECFEE3F.2000701@redhat.com> Date: Fri, 25 Nov 2011 20:36:31 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <71e840e5-083a-48f1-b7e7-c9c0feaef35c@zmail13.collab.prod.int.phx2.redhat.com> <4ECFC8BF.6060303@adacore.com> In-Reply-To: <4ECFC8BF.6060303@adacore.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] main: switch qemu_set_fd_handler to g_io_add_watch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: Blue Swirl , Anthony Liguori , qemu-devel@nongnu.org On 11/25/2011 05:56 PM, Fabien Chouteau wrote: >>> >> Is it possible to use both? Keep the select scheme for iohandlers and >>> >> slirp, but use g_main_context_iteration() for Glib stuff. >> > >> > Perhaps with two threads, but I think it's more complicated than >> > merging the handle/fd sets and doing a single poll. > Why two threads? Because you have two disjoint sets of file descriptors (iohandler+slirp and glib), both of which have to be waited on for a possibly infinite file. You cannot do that at the same time without two threads (unless you alternatively poll one and the other). Paolo