Re: perform_work, pending_work, can't work when blocking



Hi,

> > I see someone has at least thought about this by the tantilizing but
> > unimplemented pending_work and perform_work methods in
> > orbitcpp_orb.hh.
> >
> > Does anyone else have the need for this?  Is anyone working on it?
> > I've  hacked a version that sets an alarm in src/IIOP/connection.c
> > before select is called, then perform my work in the signal handler.
> > This is inferior to a real implementation.  If anyone is working on a
> > real implementation, please let me know so I can help and use it.  If
> > no one is working on this, also let me know and perhaps I will then
> > write the real implementation.
> 
> I have need for this, to implement a sort of timeout on various objects, for
> protection from clients that misbehave. Luckily I don't need it right now,
> but I will soon.
> 
> If all you're trying to do is avoid blocking (synchronous) operations, then
> you can use DII or a multithreaded ORB for the server.
> 
> If you want a timeout event, then the best way is probably for the ORB to use
> the glib event loop instead of calling select() directly.
>
> There have been murmurs about the next version of ORBit using the glib event
> loop, which would make it possible to register your own timeout events. I
> don't know if that's still part of the plan. Multithreading support was also
> mentioned a few times, but again, I don't know if that's still part of the
> plan either. Would any ORBit developers (Elliot?) like to comment?

ORBit2 uses the glib main loop and I will port ORBit-mt to ORBit2 once that is
released. Then it maybe is merged back into the main line again.

> You can find a multithreaded ORB (ORBit-mt) at:
> 
> http://goethe.ira.uka.de/~wilhelmi/corba/orbit-mt.html
> 
> I'm fairly sure that ORBit-mt uses the glib event loop, meaning you should
> be able to register your own timeout events instead of using a signal
> handler.

Yes. That's quite easy. But if you just need the glib main loop and no
multithreading, then I would simply look at 

http://cvs.gnome.org/bonsai/cvsblame.cgi?file=gnome-libs/libgnorba/Attic/orbitgtk.c

Look for IIOPAddConnectionHandler and IIOPRemoveConnectionHandler and
orb_(add|remove|handle)_connection there.

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]