Re: Corba & MultiThreading (was Re: Orb choosing time)

Philip Dawes <> writes:

> Tom Tromey wrote:
> > 
> > Philip> 1) Hack the code for both gtk and mico/omniorb to combine both
> > Philip> blocking calls into one super gnome gtk/corba blocking
> > Philip> call. (processes the gtk loop, then processes the omniorb
> > Philip> loop).  Unfortunately this will require both loops to be
> > Philip> non-blocking, and may invove select() and the like.
> > 
> > gtk_main_loop is already running select.  You don't have to process
> > one set of events and then the other -- instead you integrate the main
> > loops.  This is no big deal.  If Mico can't do this, well, then that's
> > a strike against Mico.
> > 
> > Tom
> Of course, one of the points of only supporting free software is so that
> we can modify it if it doesn't meet our requirements.
> I'm not that sure what you have in mind:
> Would it be possible to 'integrate the main loops' without modifying
> mico? That would be the best bet, since otherwise we'd have to modify
> each new version as it comes out, and anybody wanting to run a mico app
> that wasn't gnome-mico specific would have to have a seperate copy
> (unless the modification isn't mico specific).

MICO _does_ have provisions for intrgrating with alternate main loops.
See include/mico/x11.h auxdir/  Creating a GTK dispatcher
would be as easy - and could be done without modifying the MICO
at all. (The modularity of MICO is its big advantage)

> My previous experience with gtk (about 10 months ago) was that
> gtk_main_loop (which repeatedly called gtk_iteration or something like
> that) blocked on waiting for the next event from X.
> I took that block out (i.e. check the queue, then proceed or re-loop,
> not block until it fills up) at the time, integrated this in a timed
> event loop (iterate once every 50th of a second), and witnessed some
> shakey behaviour when lots of events happened (some events being lost,
> gtk locking up).

I'm not sure what you did. But GTK has a quite capable main loop -
it can handle

 - recursion
 - timeouts
 - read/write/except input/output handlers

Which should be quite sufficient for an ORB.

If you need actual non-blocking behavior, you can get it with

while (gtk_events_pending ())

(Note, gtk_events_pending, not gdk_events_pending - using that
_will_ cause shaky behavior)

I won't guarantee that there are absolutely no bugs, but if you
find any, we'll fix them.


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