From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaKs8-00006M-Iy for qemu-devel@nongnu.org; Fri, 11 Sep 2015 05:43:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaKs7-00063g-Fv for qemu-devel@nongnu.org; Fri, 11 Sep 2015 05:43:56 -0400 Date: Fri, 11 Sep 2015 10:43:45 +0100 From: "Daniel P. Berrange" Message-ID: <20150911094345.GC21525@redhat.com> References: <1438144934-23619-12-git-send-email-famz@redhat.com> <55B882C1.8070500@redhat.com> <20150729105725.GA10376@ad.nay.redhat.com> <55B8B2C3.9050307@redhat.com> <20150729115333.GA15022@ad.nay.redhat.com> <55B8C12D.2070105@redhat.com> <20150909032205.GA10922@ad.nay.redhat.com> <55F28D99.5060908@redhat.com> <20150911091433.GA6759@ad.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: kwolf@redhat.com, Fam Zheng , qemu-block@nongnu.org, qemu-devel@nongnu.org, stefanha@redhat.com, Paolo Bonzini On Fri, Sep 11, 2015 at 11:36:10AM +0200, Alberto Garcia wrote: > On Fri 11 Sep 2015 11:14:33 AM CEST, Fam Zheng wrote: > > >> > Another advantage for bdrv_aio_poll() is, in main loop we will not > >> > need a separate AioContext in changes like: > >> > > >> > http://patchwork.ozlabs.org/patch/514968/ > >> > > >> > Because nested aio_poll will automatically be limited to only > >> > process block layer events. My idea is to eventually let main loop > >> > use aio_poll > >> > >> That would be a step back. Using GSource is useful because it lets > >> you integrate libraries such as GTK+. > > > > Can we move GTK to a separate GSource thread? > > I think that GTK should always run in the main thread, or at least the > one running the default main loop / GMainContext. In theory GTK can run from a separate thread, but my experiance with GTK and threads is that you end up in a world of hurt if you try to anything except use the main thread, so I'd really recommend against it. Even if you do extensive testing locally, things still break across different GTK versions people have, so its just not worth the pain. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|