qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] WIP coroutine support in GLib
@ 2013-11-26 15:06 Marc-André Lureau
  2013-11-26 15:12 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Marc-André Lureau @ 2013-11-26 15:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Paolo Bonzini, stefanha

Hi there,

At least 3 glib projects share a similar coroutine implementation
(gtk-vnc, spice-gtk and qemu). So I decided to propose adding
coroutine support in GLib. I made some changes regarding the API to be
slightly more generic. I invite you to review and participate to the
RFC bug https://bugzilla.gnome.org/show_bug.cgi?id=719362.

If the proposal isn't refused, I'll keep working on it as it's
incomplete at this point and will provide a qemu patch as a proof of
concept.

cheers

-- 
Marc-André Lureau

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] WIP coroutine support in GLib
  2013-11-26 15:06 [Qemu-devel] WIP coroutine support in GLib Marc-André Lureau
@ 2013-11-26 15:12 ` Paolo Bonzini
  2013-11-26 15:21   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2013-11-26 15:12 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Kevin Wolf, qemu-devel, stefanha

Il 26/11/2013 16:06, Marc-André Lureau ha scritto:
> Hi there,
> 
> At least 3 glib projects share a similar coroutine implementation
> (gtk-vnc, spice-gtk and qemu). So I decided to propose adding
> coroutine support in GLib. I made some changes regarding the API to be
> slightly more generic. I invite you to review and participate to the
> RFC bug https://bugzilla.gnome.org/show_bug.cgi?id=719362.
> 
> If the proposal isn't refused, I'll keep working on it as it's
> incomplete at this point and will provide a qemu patch as a proof of
> concept.

Note that makecontext does not work on at least ARM (and I think some
BSDs too), hence the sigaltstack-based implementation that QEMU has.
Unfortunately, I don't think glib can "steal" a signal from the
application like QEMU does.

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] WIP coroutine support in GLib
  2013-11-26 15:12 ` Paolo Bonzini
@ 2013-11-26 15:21   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2013-11-26 15:21 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Kevin Wolf, Marc-André Lureau, QEMU Developers,
	Stefan Hajnoczi

On 26 November 2013 15:12, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 26/11/2013 16:06, Marc-André Lureau ha scritto:
>> At least 3 glib projects share a similar coroutine implementation
>> (gtk-vnc, spice-gtk and qemu). So I decided to propose adding
>> coroutine support in GLib. I made some changes regarding the API to be
>> slightly more generic. I invite you to review and participate to the
>> RFC bug https://bugzilla.gnome.org/show_bug.cgi?id=719362.
>>
>> If the proposal isn't refused, I'll keep working on it as it's
>> incomplete at this point and will provide a qemu patch as a proof of
>> concept.
>
> Note that makecontext does not work on at least ARM (and I think some
> BSDs too),

We did get makecontext() fixed in ARM glibc, so unless you're still
using an ancient glibc you're probably OK. The general point
remains though -- coroutines in C are nastily non-portable,
which is why qemu has four different implementations of the
basic primitives.

Personally I think the correct answer is to accept that C is
not a language with coroutines (or to push for them to be
added to the next version of the C standard).

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-26 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-26 15:06 [Qemu-devel] WIP coroutine support in GLib Marc-André Lureau
2013-11-26 15:12 ` Paolo Bonzini
2013-11-26 15:21   ` Peter Maydell

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).