[Spice-devel] Some notes on threading and reference counting on spice-server
Frediano Ziglio
fziglio at redhat.com
Thu Aug 31 12:22:04 UTC 2017
>
> On Fri, Aug 25, 2017 at 01:07:17PM -0400, Frediano Ziglio wrote:
> > Reference counting and owning
> > -----------------------------
> > -> pointer
> > ---> pointer with owning (mostly GObject ref counting)
> >
> > ChannelClient -> Client
> > Client ---> ChannelClient
>
> Something which occurred to me during the night, we have Client owning
> objects running in other threads (for example, DisplayChannelClient),
> this means among other things that if we were to
> g_object_unref(DisplayChannelClient) from the Client thread,
> DisplayChannelClient dispose/finalize are going to be run from the
> Client thread rather than from the DisplayChannelClient thread. This
> could be unexpected. Maybe it would be better if it was Channel which
> owned that reference rather than Client?
>
> Christophe
>
Interesting point. Actually in master RedChannelClients are ALWAYS
released in the main thread. So, surely is tested.
Not thinking about changing the reference actually. This morning
I was thinking how difficult would be to move the RedWorkers
in another process instead of another thread! Some interesting
though about how the design would break or not and where.
Frediano
More information about the Spice-devel
mailing list