Received: from eggs.gnu.org ([208.118.235.92]:42059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShzXx-0005DW-7Z for qemu-devel@nongnu.org; Fri, 22 Jun 2012 04:48:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ShzXv-0002j4-FY for qemu-devel@nongnu.org; Fri, 22 Jun 2012 04:48:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ShzXv-0002in-7a for qemu-devel@nongnu.org; Fri, 22 Jun 2012 04:48:51 -0400 From: Markus Armbruster References: <1340347459-29861-1-git-send-email-peter.crosthwaite@petalogix.com> <4FE423B0.9020702@siemens.com> Date: Fri, 22 Jun 2012 10:48:44 +0200 In-Reply-To: (Peter Maydell's message of "Fri, 22 Jun 2012 09:16:41 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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:00, Peter Crosthwaite > wrote: >> On Fri, Jun 22, 2012 at 5:50 PM, Jan Kiszka wrote: >>> Not sure if I understood the intention yet: Is this supposed to fix an >>> issue with the current usage of coroutines or to extend their usage >>> beyond that? In the latter case, please don't do this. We'd rather like >>> to get rid of them long term. > >> My extended usage, which is under development and not ready for the >> list. But are you saying qemu-coroutine is deprecated? If so Ill just >> re-impelement my work with threads, mutexes and condition vars, but >> coroutines are the most natural way of doing it. > > Basically coroutines are nastily unportable and we've had a set > of problems with them (as witness the fact that we have three > separate backend implementations!). There is supposedly some sort > of migration plan for getting them out of the block layer eventually; > they're a kind of halfway house for avoiding synchronous I/O there > AIUI. I would much prefer not to see any further use of them in new > code. Fundamentally C doesn't support coroutines and it's much better > to just admit that IMHO and use more idiomatic design approaches > instead. I think you're overstating your case. People have been doing coroutines in C for decades, on a huge range of machines. They wouldn't have done so if it wasn't worth their while. Not what I'd call a "fundamental" problem. In my opinion, coroutines have been useful for us so far. Whether they remain useful, or serve us just as a stepping stone towards general threads remains to be seen. As Kevin said, there are no concrete plans to convert the block layer away from coroutines.