qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/3] New sigaltstack method for coroutine


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 0/3] New sigaltstack method for coroutine
Date: Mon, 13 Feb 2012 14:51:31 +0000

On 13 February 2012 14:42, Alex Barcelo <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]