Re: Changes to the GLib main loop [ g_main_iterate() ]
- From: Sebastian Wilhelmi <wilhelmi ira uka de>
- To: vishnu pobox com
- Cc: Owen Taylor <otaylor redhat com>, gtk-devel-list gnome org
- Subject: Re: Changes to the GLib main loop [ g_main_iterate() ]
- Date: Wed, 20 Jun 2001 12:09:22 +0200
Hi Joshua
> > > I'd tend to agree that the structure should be:
> > >
> > > * One thread handles incoming events, and dispatches all slow
> > > operations to other threads.
> > >
> > > It's not the only way people try to write things, but probably we
> > > just need to educate people.
> >
> > Yes. Also I don't think, this is something that people will often use
> > in normal applications. So that shouldn't be a problem.
>
> For what it's worth, i wrote an event loop for Perl. The code is blind
> to threads because i don't know how is it possible to improve upon:
>
> "One thread handles incoming events, and dispatches all slow
> operations to other threads."
I fully agree, that's also how I solved that for ORBit-mt.
The point of our discussion is a bit different, because you can use
g_main_context_iterate or better g_main_context_run not only to dispatch
events, but also to just wait for all events being dispatched and/or the main
loop being terminated, and that is very well interesting for other threads
too.
Bye,
Sebastian
--
Sebastian Wilhelmi
mailto:wilhelmi ira uka de
http://goethe.ira.uka.de/~wilhelmi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]