Invoking GTK main thread from other threads
Benjamin Quinn via gtkmm-list <[email protected]> Thu, 10 Sep 2020 12:40:54 -0400
| Newsgroups | gmane.comp.gnome.gtkmm |
|---|---|
| Message-ID | <CAL7GaSmu3HxFCuFzeBwWOjw2X8Ei3vBrdvnm4eHZ=-khVg1atA@mail.gmail.com> |
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 <https://github.com/Blquinn/idlequeue>. 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. Best, -Ben _______________________________________________ gtkmm-list mailing list [email protected] https://mail.gnome.org/mailman/listinfo/gtkmm-list