Invoking GTK main thread from other threads

Hey all,

I've been working on a project using gtkmm and I was looking at the multithreading docs. It seems that the recommended way to send data to the UI thread is to use a Gtk::Dispatcher to signal data has changed and a mutex to synchronize that data.

Using other bindings, such as GTK#, you have callback methods available to run a function on the main thread, which can be safely invoked from other threads.

I created a simple implementation of this for gtkmm here. The architecture is described in the readme.

Let me know what you all think, or if there's any huge issues with it, I'm new to c++ development, so there's a good chance this is not safe at all.


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