Received: from eggs.gnu.org ([208.118.235.92]:47772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si2bW-0004fB-VM for qemu-devel@nongnu.org; Fri, 22 Jun 2012 08:04:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Si2bR-0005EA-Mk for qemu-devel@nongnu.org; Fri, 22 Jun 2012 08:04:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si2bR-0005Dv-Ek for qemu-devel@nongnu.org; Fri, 22 Jun 2012 08:04:41 -0400 From: Markus Armbruster References: <1340347459-29861-1-git-send-email-peter.crosthwaite@petalogix.com> <4FE423B0.9020702@siemens.com> Date: Fri, 22 Jun 2012 14:04:34 +0200 In-Reply-To: (Peter Maydell's message of "Fri, 22 Jun 2012 10:06:13 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC] block: Removed coroutine ownership assumption List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: kwolf@redhat.com, stefanha@linux.vnet.ibm.com, Jan Kiszka , qemu-devel@nongnu.org, Peter Crosthwaite , edgar.iglesias@gmail.com, john.williams@petalogix.com Peter Maydell writes: > On 22 June 2012 09:48, Markus Armbruster wrote: >> In my opinion, coroutines have been useful for us so far. =C2=A0Whether = they >> remain useful, or serve us just as a stepping stone towards general >> threads remains to be seen. > >>From my point of view I've seen a whole pile of problems and not > really any advantages... Advantages over what? > I particularly think it's a really bad > idea to have a complex and potentially race-condition-prone bit > of infrastructure implemented three different ways rather than > having one implementation used everywhere -- it's just asking > for obscure bugs on the non-x86 hosts. Fair point, but it's an implementation problem, not a fundamental problem with coroutines. You *can* implement coroutines portably, e.g. on top of gthread. But there's a portability / speed tradeoff. Kevin already explained we chose speed over portability initially, and that choice is open to revision. > Really it just breaks the general rule I prefer to follow that > you should write your code in the 'mainstream' of an API/platform; > if you head too close to the shallows you're liable to hit a rock. It's a good rule. Like for most rules, there are exceptions.