Threading and glib main



Hi,

I was thinking of using a seperate mainloop for another thread
when I realized (read in the reference manual) that the glib
main loop is global.  I'd mainly like to watch for input on
some fds in a thread which is not the one where the GUI stuff is
beeing handled, with as little effort as possible.

I had the following alternative ideas:

- handling read-ready on the X fd is done in another thread, not
  the thread calling select.  So all Gtk works would just
  be done there on default, including calls to XSync.  Is there a
  way to do this with a (few) call(s) ?

- use one seperate thread for running the select loop (custom,
  not glib) for the other fds.  While a little more work than
  the other idea, could Gtk+ live with this and would I just need
  to call g_main_wakeup or set an idle handler to "notify" the
  main thread carrying select ?

Best regards,
kai



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