Re: multithreaded gtk app



Hi,

I rare to use GDK locks method on another thread, as it's described in GTK+ FAQ that X server receive command 
in batch mode, that's means command or request will not be send immediately, if you do GTK+ call on another 
thread except the main thread, GTK+ will now know how to send that command out. You many want to see 
http://library.gnome.org/devel/gtk-faq/stable/x491.html

For GTK+ call in another thread, if possible I will try to use some of these function in that thread (rather 
than using locking/unlocking and flush semantics that very complicated), they do their job in the main loop 
that is the main thread, they are as you may already know:

g_timeout_add(), g_timeout_add_full(), g_idle_add(), g_idle_add_full(), etc.

Notice that GLib main loop functions are all thread safe.

            - Ardhan

_____________________________________________________________
Listen to KNAC, Hit the Home page and Tune In Live! ---> http://www.knac.com



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