On Sat, Jan 30, 2010 at 02:20:13 +0100, Jiří Zárevúcky wrote:
> Nor Jaidi Tuah píše v So 30. 01. 2010 v 09:07 +0800:
> > 
> > [...]
> > 
> > So, I emulate gtkmm's Dispatcher by replacing this:
> > 
> >   a_signal.connect ((arg) => { things_to_do (); });
> > 
> > with:
> > 
> >   a_signal.connect ((arg) => { 
> >      Idle.add_full (Priority.HIGH, () => things_to_do (); });
> >   });
> > 
> > Seems to work fine. I began to wonder why the gtkmm's
> > Dispatcher makes contorted use of pipes.
> > 
> 
> Performance reasons, most likely.

I would not think so, even though it might have some slight advantage (adding
source to other thread's GLib.MainContext does involve some locks while pipes
do not). Rather I would expect it either pre-dates some important API changes
regarding threads and main loops in GLib (it used to miss a couple of things
and working with non-default contexts is still a bit unwieldy), or the author
didn't think about this method.

-- 
                                                 Jan 'Bulb' Hudec <[email protected]>
_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to