Re: [PATCH spice-server 16/16] red-worker: Start processing commands as soon as possible

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

 



On Mon, Sep 11, 2017 at 04:03:18AM -0400, Frediano Ziglio wrote:
> ping
> 
> > 
> > When the worker is started it could take a while to start
> > processing commands.
> > The reason is that the dispatcher handler is called after
> > the worker so GLib will receive a FALSE answer to both
> > prepare and check callbacks of the RedWorkerSource causing
> > GLib to wait till another event is received.

So we may have messages from the main thread to the worker thread
delayed until another (non-dispatching related) event wakes up the glib
main loop? Or do you mean something else?

If that's correct, maybe makes this a bit more explicit in the log, and
Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>



> > This is a regression since the introduction of GLib event
> > loop, before the command processing was always attempted
> > after any events.
> > Setting the event_timeout to 0 cause the prepare callback
> > to return TRUE so GLib will dispatch the RedWorkerSource.
> > This was discovered attempting to use the tests in server/tests
> > directory to reproduce a leak in RedWorker.
> > 
> > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> > ---
> >  server/red-worker.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/server/red-worker.c b/server/red-worker.c
> > index 594dec55..c02674ba 100644
> > --- a/server/red-worker.c
> > +++ b/server/red-worker.c
> > @@ -635,6 +635,7 @@ static void handle_dev_start(void *opaque, void *payload)
> >          display_channel_wait_for_migrate_data(worker->display_channel);
> >      }
> >      worker->running = TRUE;
> > +    worker->event_timeout = 0;
> >      guest_set_client_capabilities(worker);
> >  }
> >  
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://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]