Re: GTK app misbehaving. (main thread blocking)



Tim Müller wrote:
GLib, in particular the GLib main loop stuff, is thread-safe, so when you
do a simple g_idle_add() or g_timeout_add() from your work thread, the
dispatch will actually be happening from the main context/thread. That's
the easiest way to get stuff across to the main thread.

Just to correct my unfortunate phrasing before anyone else does: of course 
GLib as a whole isn't thread safe (data structures etc. are not as far as I 
know), but the GMainLoop/GMainContext stuff is.

Cheers
 -Tim



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