From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPFck-0000lS-JO for qemu-devel@nongnu.org; Wed, 25 May 2011 11:03:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPFcj-0007RU-Kr for qemu-devel@nongnu.org; Wed, 25 May 2011 11:03:50 -0400 Received: from mail-ww0-f53.google.com ([74.125.82.53]:37585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPFcj-0007RN-GC for qemu-devel@nongnu.org; Wed, 25 May 2011 11:03:49 -0400 Received: by wwj40 with SMTP id 40so7686858wwj.10 for ; Wed, 25 May 2011 08:03:48 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4DDCB094.6080100@redhat.com> Date: Wed, 25 May 2011 09:32:36 +0200 From: Paolo Bonzini MIME-Version: 1.0 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> <20110511135154.GU2661@redhat.com> <20110524193750.GQ969@shareable.org> <20110524195812.GA13211@stefanha-thinkpad.localdomain> <4DDC2175.3020107@codemonkey.ws> In-Reply-To: <4DDC2175.3020107@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] coroutine: introduce coroutines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , Anthony Liguori , Venkateswararao Jujjuri , Stefan Hajnoczi , qemu-devel@nongnu.org On 05/24/2011 11:21 PM, Anthony Liguori wrote: > Why not use threads as a coroutine fallback? That's essentially what we > would do to be "fully threaded". Not exactly, there would be much less synchronization going on. Using threads to implement coroutines means you go through the slow path of the synchronization primitives (either mutexes/condvars or barriers) twice or more per coroutine switch. It is really slow, a 100 times difference perhaps. Paolo