Re: [spice-gtk 2/3] coroutine: Track idle notification/emission in struct coroutine

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

 



On Mon, Feb 23, 2015 at 07:02:07AM -0500, Marc-André Lureau wrote:
> 
> 
> ----- Original Message -----
> > This allows to catch situations when we try to reinit the coroutine
> > using coroutine_init() while a signal/notify idle is pending.
> > 
> > This can actually happen with cancelled migration and connect_delayed
> > (which reinits the current coroutine).
> > If channel_disconnect is called from coroutine context when state is
> > SPICE_CHANNEL_STATE_SWITCHING:
> >     - channel_connect() is called and queues an idle which will call
> >       connect_delayed()
> >     - then spice_session_set_migration_state() is called and will call
> >       g_coroutine_object_notify(), which will queue an idle to emit the
> >       notification, and yield to the main context
> >     - connect_delayed() gets called in an idle, resets the current
> >       coroutine, and then yield back to the coroutine context
> >     - g_coroutine_object_notify() resumes and is confused as the
> >       notification did not happen.
> > 
> > This can be triggered by adding a g_usleep(10000000); at the beginning
> > of spice_session_start_migrating(), and by migrating an oVirt VM after
> > connecting to it.
> 
> Can it still be triggered?

Nope, I'll amend the log.

> 
> > 
> > This is based on a patch suggestion from Marc-André.
> > ---
> >  gtk/coroutine.h          |  1 +
> >  gtk/coroutine_ucontext.c |  5 +++++
> >  gtk/gio-coroutine.c      | 16 ++++++++++++----
> >  3 files changed, 18 insertions(+), 4 deletions(-)
> > 
> > diff --git a/gtk/coroutine.h b/gtk/coroutine.h
> > index 78dc467..5525fd3 100644
> > --- a/gtk/coroutine.h
> > +++ b/gtk/coroutine.h
> > @@ -53,6 +53,7 @@ struct coroutine
> >  	GThread *thread;
> >  	gboolean runnable;
> >  #endif
> > +	guint idle_id;
> >  };
> 
> With GCoroutine we won't be able to add fields to the structs.

I made alternative suggestions in 0/3 to avoid adding that new field.

> 
> In general, all coroutine specific data must be allocated by the
> coroutine itself, either on the stack or by it's own. You'll have to
> create your own interaction protocol to exchange (get/set) these kind
> of data.

I'm not exactly sure what you are suggesting me to do here.

Christophe

Attachment: pgpoEtajlJNsz.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]