Re: Does gtk have issues with STL?



On Tue, 2008-02-12 at 08:56 -0500, Lindley M French wrote:
> Interesting. So g_idle_add can be safely called from a different thread? Does it have to be a gthread, or will a pthread work as well?

You can use pthreads under glib without problems.  For Unix-like
systems, gthreads is only a wrapper for pthreads.

However, you need to call g_thread_init() to make glib (including
g_idle_add()) thread safe, whether you are using gthreads or using
pthreads directly.  You do not need to call gdk_thread_init() if you are
only invoking GDK/GTK+ functions by message passing via g_idle_add()
(that is, if you are not calling gdk_threads_enter()/leave()).

Chris




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