Re: Threads and main-loops
- From: Tristan Van Berkom <vantr touchtunes com>
- To: Russell Shaw <rjshaw netspace net au>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Threads and main-loops
- Date: Thu, 02 Sep 2004 10:33:28 -0400
Russell Shaw wrote:
[...]
Hi,
Thanks, is clearer now. I needed to have a mental model (i think visual)
of threading and loop contexts to design the overall architecture of my
app.
Note that you can create multiple threads and run GMainLoops in each
thread, but its a little tricky.
Functions which create and manipulate event sources under the hood
need to be avoided (i.e. g_timeout_add, g_idle_add, g_io_add_watch) as
they assume the default GMainContext (which is OK if you intend to queue
events to the default GMainLoop from another thread), instead; you would
need to use the slightly more complex varients (i.e. g_idle_source_new
in conjunction with g_source_attatch et al).
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]