All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, Blue Swirl <blauwirbel@gmail.com>,
	Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v4 1/3] coroutine: introduce coroutines
Date: Fri, 20 May 2011 13:32:51 +0100	[thread overview]
Message-ID: <BANLkTinWi2GQ3cg0y13y9DvROx9iVt4ATg@mail.gmail.com> (raw)
In-Reply-To: <4DD659E9.7020501@redhat.com>

On Fri, May 20, 2011 at 1:09 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 05/20/2011 12:59 PM, Stefan Hajnoczi wrote:
>>
>> This coroutines implementation is based on the gtk-vnc implementation
>> written by Anthony Liguori<anthony@codemonkey.ws>  but it has been
>> significantly rewritten by Kevin Wolf<kwolf@redhat.com>  to use
>> setjmp()/longjmp() instead of the more expensive swapcontext() and by
>> Paolo Bonzini<pbonzini@redhat.com>  for Windows Fibers support.
>>
>
> Not a blocker at all, but why did you move the pooling to the ucontext
> implementation?  It's less expensive to create the fiber in Windows because
> there are no system calls (unlike swapcontext), but a future pthread-based
> implementation will also need the pooling.
>
> It can be left to whoever writes the pthread stuff, though.

There are two options for pooling:
1. Thread-local pools
2. One global pool with a lock

One of these choices must be selected because otherwise the pool could
be accessed simultaneously from multiple threads.  I tried #2 first
because it was less code but it caused a noticable slow-down with
./check-coroutine --benchmark-lifecycle.  Option #1 had less impact
but requires using thread-local storage, which I've used pthread APIs
for.  Hence I moved it into coroutine-ucontext.c hoping that win32
would either be fast enough as-as or that we could find a better
solution if someone needs it.

Stefan

  reply	other threads:[~2011-05-20 12:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20 10:59 [Qemu-devel] [PATCH v4 0/3] Coroutines for better asynchronous programming Stefan Hajnoczi
2011-05-20 10:59 ` [Qemu-devel] [PATCH v4 1/3] coroutine: introduce coroutines Stefan Hajnoczi
2011-05-20 12:09   ` Paolo Bonzini
2011-05-20 12:32     ` Stefan Hajnoczi [this message]
2011-05-21  7:35   ` Blue Swirl
2011-05-20 10:59 ` [Qemu-devel] [PATCH v4 2/3] coroutine: add check-coroutine automated tests Stefan Hajnoczi
2011-05-20 22:14   ` Anthony Liguori
2011-05-23  5:34     ` Stefan Hajnoczi
2011-05-20 10:59 ` [Qemu-devel] [PATCH v4 3/3] coroutine: add check-coroutine --benchmark-lifecycle Stefan Hajnoczi

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=BANLkTinWi2GQ3cg0y13y9DvROx9iVt4ATg@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=blauwirbel@gmail.com \
    --cc=jvrao@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.