Glib and Multithreading Manual


Is anywhere book or good manual, but better book about GTK+/glib, and multithreading in C/GTK+? I need to run a function in another thread than main window, and make it cancellable.

GCancellable is part of the GIO I/O library. It provides a thread-safe way to simply send a "cancel yourself" message, and should be easy to implement in a thread of your own.

Simply create an instance of GCancellable using g_cancelablle_new(), and then either poll it periodically (using g_cancellable_is_cancelled()) in your thread, or use the signal support.