Main loop revision



I've put up a proposal for a revision of the GLib main loop at:

 http://www.gtk.org/~otaylor/gtk/2.0/main-loop.html

To quickly summarize what I'm proposing changing:

 - the collection of sources is stored in a GMainContext
   object; separate GMainContext objects can be created
   an run in different threads.

 - If g_main_run() is called from a different thread than
   the thread for the main loop, then instead of failing
   it waits for g_main_quit() by a mechanism such as
   a semaphore

 - We identifiy sources primarily by 'GSource *' rather
   than numeric ID.

 - the internals of the main loop are exposed to a degree
   to allow integrating the GLib main loop better into
   other systems. 

Unfortunately, the change necessitates, once again, marking most of
the main-loop API as obsolete, if still functional, and introducing a
new set of functions. As you'll see when you read the proposal, one
reason for introducing the 'GSource *' is to switch to an API
that can better be extended in the future without breaking
everything.

Regards,
                                        Owen





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