Hi Everyone:

 I am a bit lost concerning the usage of the relationship between Main event
loop and thread in Glib.

 If I use g_timeout_add_full in some callback function ,will it start a
"thread" to do it ? Or just add a new "source" to be handled by
 main event loop without thread?

 What's the relationship with thread , source  and main event loop ?
 How should I understand these comments ?
"

The main event loop manages all the available sources of events for GLib and
GTK+ applications. These events can come from any number of different types
of sources such as file descriptors (plain files, pipes or sockets) and
timeouts. New types of event sources can also be added using
g_source_attach()<file:///usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#g-source-attach>.


To allow multiple independent sets of sources to be handled in different
threads, each source is associated with a
GMainContext<file:///usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GMainContext>.
A 
GMainContext<file:///usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GMainContext>can
only be running in a single thread, but sources can be added to it and
removed from it from other threads.
"


 Thanks a lot!
 grassroot
_______________________________________________
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to