From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwxFd-0005um-9M for qemu-devel@nongnu.org; Mon, 13 Feb 2012 09:51:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RwxFc-0006m2-30 for qemu-devel@nongnu.org; Mon, 13 Feb 2012 09:51:33 -0500 Received: from mail-qy0-f173.google.com ([209.85.216.173]:57498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwxFc-0006lu-0s for qemu-devel@nongnu.org; Mon, 13 Feb 2012 09:51:32 -0500 Received: by qcsc20 with SMTP id c20so3121283qcs.4 for ; Mon, 13 Feb 2012 06:51:31 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1329144150-7720-1-git-send-email-abarcelo@ac.upc.edu> References: <1329144150-7720-1-git-send-email-abarcelo@ac.upc.edu> Date: Mon, 13 Feb 2012 14:51:31 +0000 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 0/3] New sigaltstack method for coroutine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Barcelo Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org On 13 February 2012 14:42, Alex Barcelo wrote: > This series of patches implements coroutines method with > sigaltstack. > > The flow of creation and management of the coroutines is > quite similar to the coroutine-ucontext.c. The way to use > sigaltstack to achieve the needed stack manipulation is > done in a way quite similar to the GNU Portable Threads > (file pth_mctx.c, variant 2). So the obvious question here is why this should be a new coroutine method rather than just replacing the ucontext one. Having a tricky bit of code like the coroutine implementation have multiple implementations is asking for the less-used ones to bitrot, have undetected race conditions, etc. I would much prefer it if we could have one standard implementation that was used on all (unixy) platforms. The ucontext implementation is problematic because makecontext &co aren't implemented on all platforms (ARM Linux, and I think at least one of the BSDs?). Is this sigaltstack approach workable on a strict superset of the platforms that would be able to use ucontext? Does it have any disadvantages that would mean you wouldn't want to use it as a first choice if you had ucontext? -- PMM