Is gtkmm thread-safe?
Paul Davis wrote: Neither X, nor GDK nor GTK+ nor gtkmm are thread safe by themselves. You must use either the gdk_threads_{enter,leave}() functions to protect any and every call to GDK/GTK+/gtkmm functions, or alternatively, ensure that only a single thread makes such calls. One common way to do this is to have non-GUI threads send requests to the GUI thread via a pipe. The pipe is hooked into the main glib event loop used by GTK. Personally, i have always used the single-threaded approach, which I find much more suitable for my apps. Note that glibmm comes with Glib::Dispatcher, which implements a cross-thread signal using the pipe approach described above. Andreas Rottmann added: If you need a more sophisticated cross-thread message-passing approach, take a look at libsigc++ extras. It provides cross-thread, typesafe slot invocation on top of libsigc++ and comes with a gtkmm example.