Re: Changes to the GLib main loop



I don't understand the intricate details of the GLib
event loop implementation, but here's what I'm trying
to do using GLib 2.0.


Owen Taylor wrote:
> 
> Sebastian Wilhelmi <wilhelmi ira uka de> writes:
> 
> > 1) I can add sources to a context and only then create a thread, where a
> >    main loop for that context is running (not possible now).

I would like to have that, too.


> One of things I wanted to achieve going into my main loop changes
> for GLib-2.0 was that people would be able to integrate the GLib
> main loop with other main loops that worked in different
> ways. This is the reason for making these functions public,
> and I think you're changes break this ability.

I need the ability to integrate a library which uses the GLib
main loop and GIOChannels for asynchronous I/O into a multithreaded
application:
- threads from the application call a library function which
  creates a GIOChannel and registers it with a GMainContext
  (needs something like g_io_add_watch_to_context())
- another thread needs to iterate the GLib main loop to dispatch
  callbacks to the application

Summary:
- I need to add event sources to another thread's GMainContext.
- It would be nice if a g_io_add_watch() extension with a
  GMainContext paramter existed.
- It would be nice if I could create that GMainContext before
  starting the other thread.


Regards,
Johannes




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