Re: gtkmm 3.4.0 (gtk 3.4.2) multithread app graphic deterioration



On 08/07/2012 16:25, Chris Vine wrote:
> On Sun, 8 Jul 2012 08:53:28 +0200
> Giuseppe Penone <giuspen gmail com> wrote:
>> Thank you Chris, I'll read more about this Glib::Dispatcher, in the
>> past I already took a look but then discouraged and used gdk lock
>> that I already was able to use.
> 
> The main problem you will come across using Glib::Dispatcher is passing
> data to the callback.  For that, it is best to use an asynchronous
> queue.
> 
> In another posting you said your program does a lot of input-output.
> You don't need threads just for that: you can set up a watch on a
> file descriptor for the main GUI thread using
> Glib::signal_io().connect(). GIO/giomm also has a wide range of
> asynchronous IO functions where all the hard work is done for you.

You can actually consider using sigx[1] for that. It provides a sigx::signal
which works like Glib::Dispatcher (in that it is dispatched on the
Glib::MainContext from which it was constructed), but allows for arguments to be
passed along.

[1] http://triendl.info/sigx/

-- 
Kind regards,
Loong Jin



Attachment: signature.asc
Description: OpenPGP digital signature



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