qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] coroutine: introduce coroutines


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 1/2] coroutine: introduce coroutines
Date: Wed, 25 May 2011 11:54:43 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10

On 05/25/2011 12:09 AM, Stefan Hajnoczi wrote:
> On Tue, May 24, 2011 at 9:51 PM, Jamie Lokier <address@hidden> wrote:
>> Stefan Hajnoczi wrote:
>>> My current plan is to try using sigaltstack(2) instead of
>>> makecontext()/swapcontext() as a hack since OpenBSD doesn't have
>>> makecontext()/swapcontext().
>>
>> sigaltstack() is just a system call to tell the system about an
>> alternative signal stack - that you have allocated yourself using
>> malloc().  According to 'info libc "Signal Stack"'.  It won't help you
>> get a new stack by itself.
> 
> Issue sigaltstack() with the malloced new stack.  Send yourself a
> signal and in a custom signal handler setjmp() to stash away the state
> (you're now on the new stack).

Is any of this really easier than simply writing 20-30 lines of
assembly to do what you Really Want And Nothing Else?

Honestly, this is qemu we're talking about, and we assume you've
already ported TCG to the host cpu plus abi.  How hard is it to
just DTRT with a qemu-specific routine, anyway?


r~



reply via email to

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