[Spice-devel] [PATCH v3 4/4] worker: use glib main loop
Marc-André Lureau
mlureau at redhat.com
Wed Jan 13 04:42:52 PST 2016
Hi
----- Original Message -----
> On Wed, Jan 13, 2016 at 11:39:09AM +0000, Frediano Ziglio wrote:
> > Use the glib mainloop instead of writing our own. The glib loop is both
> > cleaner to use and is more extensible. It is also very mature and
> > reduces the maintenance burden on the spice server.
>
> Why not take it further and provide the option to do away
> with the spice event loop entirely. Having 2 threads both
> providing event loops (QEMU event loop thread + SPICE event
> loop thread) feels rather pointless. Obviously for backcompat
> you need to be able to run the event loop in SPICE thread,
> but We could provide an API which lets QEMU tell libspice
> that it can use the default GMainContext and not run its
> own.
The spice "worker" thread is where the display/cursor work takes place. It would need significant work to refactor it so the events would all be dispatched from the main thread while long job would be in one or more seperate threads.
For non-display channels, they are dispatched from the main thread already. But some relatively slow job take place in the main thread too, such as audio encoding, where a job thread would be welcome.
regards
More information about the Spice-devel
mailing list