Re: gdk threads ...
- From: Chris Vine <chris cvine freeserve co uk>
- To: Paul Davis <paul linuxaudiosystems com>
- Cc: Ryan Lortie <desrt desrt ca>, Gtk Hackers <gtk-devel-list gnome org>, michael meeks suse com
- Subject: Re: gdk threads ...
- Date: Wed, 25 Apr 2012 19:36:21 +0100
On Wed, 25 Apr 2012 13:57:46 -0400
Paul Davis <paul linuxaudiosystems com> wrote:
> On Wed, Apr 25, 2012 at 1:53 PM, Chris Vine
> <chris cvine freeserve co uk> wrote:
> > That's interesting - you have found with Ardour that attaching
> > timeout sources to a main loop is not thread safe?
> Not at all - we just don't want it. The other event loops run/provide
> support for non-Graphical UIs, and they can be
> instantiated/deinstantiated independently of the GUI. We don't want
> the handling of (for example) MIDI or OSC data to be interwoven with
> handling GUI events. Naturally, the GUI can be altered by things that
> happen in these other event loops, but that happens solely either by
> changing the model that they all interact with, or by anonymous
> cross-thread callbacks.
I was responding to your advice that "If you want other threads to be
able to set up timeout callbacks in the GUI event loop, then just use
g_idle_add() to get them set up". Something seems to have become
elided in the telling, since one thread can safely attach a timeout to a
another thread's main loop in the same way that it can attach an idle
source to it.
That is not to say that I don't agree with your general proposition, if
that is what it was, that avoiding shared mutable data where you can, by
using glib main loop sources to implement message passing, isn't a good
idea in GTK+ programs. It is a way of staying sane that I use myself.
] [Thread Prev