From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QK9ps-00045E-Lh for qemu-devel@nongnu.org; Wed, 11 May 2011 09:52:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QK9pq-0003Hq-PF for qemu-devel@nongnu.org; Wed, 11 May 2011 09:52:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QK9pq-0003HL-FV for qemu-devel@nongnu.org; Wed, 11 May 2011 09:52:18 -0400 Date: Wed, 11 May 2011 14:51:54 +0100 From: "Daniel P. Berrange" Message-ID: <20110511135154.GU2661@redhat.com> References: <1305108925-26048-1-git-send-email-stefanha@linux.vnet.ibm.com> <1305108925-26048-2-git-send-email-stefanha@linux.vnet.ibm.com> <4DCA7B64.7000900@redhat.com> <4DCA8655.3070807@codemonkey.ws> <4DCA86A1.2020306@redhat.com> <4DCA89A9.8070000@us.ibm.com> <4DCA9303.5040400@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4DCA9303.5040400@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] coroutine: introduce coroutines Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Anthony Liguori , Venkateswararao Jujjuri , Stefan Hajnoczi , qemu-devel@nongnu.org On Wed, May 11, 2011 at 03:45:39PM +0200, Paolo Bonzini wrote: > On 05/11/2011 03:05 PM, Anthony Liguori wrote: > >> > >>A very slow way, too (on Windows at least if you use qemu_cond...). > > > >That doesn't mean you can't do a fiber implementation for Windows... but > >having a highly portable fallback is a good thing. > > I agree but where would you place it, since QEMU is only portable to > POSIX and Windows? > > osdep-$(CONFIG_POSIX) += coroutine-posix.c > osdep-$(CONFIG_WIN32) += coroutine-win32.c > osdep-??? += coroutine-fallback.c NetBSD forbids the use of 'makecontext' in any application which also links to libpthread.so[1]. We used makecontext in GTK-VNC's coroutines and got random crashes in threaded apps running on NetBSD. So for NetBSD we tell people to use the thread based coroutines instead. So at least one POSIX platform will need a different impl. Regards, Daniel [1] http://www.eila.univ-paris-diderot.fr/cgi-bin/man.cgi?swapcontext+3 -- |: 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 :|