GtkObject system threadsafe?



Hello All.

I as wondering if the GtkObject system is threadsafe when
g_thread_init() is called, or if one needs to use
gdk_threads_enter()/leave() everywhere?

For example, I have a class FooBar derived from GtkObject,
with two instances (A and B) and two threads (1 and 2).

If thread 1 only uses FooBar A and thread 2 only uses FooBar B,
can I emit signals and use the arg system without the mutex?

I'm assuming I'd need to lock individual objects if they need
simultaneous access from both threads.


The FAQ says you need to call gdk_threads_enter() before all GDK
calls. In this case, I don't want any of the graphical calls,
just the object system.

Will the above answer hold true for Glib 2.0 and GObjects?

Sorry this is all hypothetical at this point. I may never
need this information :) But I thought the answer in the FAQ
was a little unclear.

Sam

-- 
Sam Hunter <shunter bigsky net>
-------------------------------
Most people can't understand how others can blow their noses differently
than they do.
                -- Turgenev




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