qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Barcelo <abarcelo@ac.upc.edu>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Coroutines and ucontext
Date: Sat, 28 Jan 2012 10:31:10 +0100	[thread overview]
Message-ID: <CAFKAgTdJRiAsL--VgQQ3r_01W4tmnsw4Q22v8kCvobEZL1fPyA@mail.gmail.com> (raw)
In-Reply-To: <4F22B71A.3020805@redhat.com>

On Fri, Jan 27, 2012 at 15:39, Paolo Bonzini wrote:
>> I have a patch that uses sigsetjmp and siglongjmp instead of
>> makecontext and getcontext (and all the ucontext stuff), and it
>> *seems* to work... but I'm not sure if it works "by accident" (not
>> sure what I'm doing to the stack, not sure what I should be doing to
>> the stack).
>
> You can post it, don't worry.  I'm curious how you are switching stacks when
> creating the coroutine.
>

I think that I'm not switching, so at first I didn't understand why
could it run at all. Now I think that qemu-img is too simple and a new
stack is not really needed (probably only one coroutine and
straightforward, I'll check it). So it doesn't crash.

Thank you very much for the advice and comments. I'll do some more
tests, I expect to achieve something useful ^^


On Fri, Jan 27, 2012 at 15:48, Daniel P. Berrange wrote:
>(...)
> If you're curious about this kind of thing you might also want to
> take a look at the GNU Pth code. In particular its pth_mctx.c
> file which has several different implementations of userspace thread
> switching, one using makecontext, another with sigstck/altstack
> and some others doing something fugly I don't understand :-)

Thanks! I will definetely look at it/them.

  parent reply	other threads:[~2012-01-28  9:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27 12:39 [Qemu-devel] Coroutines and ucontext Alex Barcelo
2012-01-27 14:39 ` Paolo Bonzini
2012-01-27 14:48   ` Daniel P. Berrange
2012-01-28  9:31   ` Alex Barcelo [this message]
2012-02-07 11:18     ` Stefan Hajnoczi
2012-02-07 16:06       ` Alex Barcelo
2012-02-07 16:23         ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFKAgTdJRiAsL--VgQQ3r_01W4tmnsw4Q22v8kCvobEZL1fPyA@mail.gmail.com \
    --to=abarcelo@ac.upc.edu \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).