Received: from eggs.gnu.org ([2001:4830:134:3::10]:51254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGQAq-0002MH-JY for qemu-devel@nongnu.org; Mon, 02 Sep 2013 05:12:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGQAh-0003om-Ts for qemu-devel@nongnu.org; Mon, 02 Sep 2013 05:11:52 -0400 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]:57458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGQAh-0003oi-NM for qemu-devel@nongnu.org; Mon, 02 Sep 2013 05:11:43 -0400 Received: by mail-ea0-f176.google.com with SMTP id q16so2208027ead.35 for ; Mon, 02 Sep 2013 02:11:42 -0700 (PDT) Date: Mon, 2 Sep 2013 11:11:40 +0200 From: Stefan Hajnoczi Message-ID: <20130902091140.GB947@stefanha-thinkpad.redhat.com> References: <4f4a2022-68e7-4fc4-aaaf-f14205d3ab0f@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4f4a2022-68e7-4fc4-aaaf-f14205d3ab0f@me.com> Subject: Re: [Qemu-devel] About coroutine inside qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yaodong Yang Cc: qemu-devel@nongnu.org On Fri, Aug 30, 2013 at 08:59:37PM +0000, Yaodong Yang wrote: > When a new work thread, which is not inside coroutine,  enter a > coroutine(named as A), what happened to the work thread? Is it true > that the work thread also become a coroutine, or it just stop? Later > if the coroutine A call yield. what happened to the work thread? qemu_coroutine_enter() returns when the coroutine yields or terminates. Therefore the thread gives its control to the coroutine until it yields or terminates. Stefan