glib main loop concept



Hi,

I have a general question about the concepts of GLib main loops.

I've read the GLib reference several times but still I don't get how
main loops internally work. To be precisely, the following questions occur:

* Do main loops exist per process or per thread?
  If I start a main loop in one thread (A) and add an IO watch in
  another thread (B), does this watch get added to the main loop of the
  thread A or B ?

* If there is only one main loop (regardless of per thread or per
  process), why the function g_main_loop_new()?

* What's the purpose of the parameter 'is_running' in
  g_main_loop_new() ? When should I set it to TRUE and when to FALSE?

Sorry for this basic questions .. if I am not the only one dealing with
these questions, maybe the GLib reference could get extended with more
details on main loops.

Cheers .. and thanks for some advise,

Christian




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