Re: [Fwd: Client *and* server?]



Katherine Goude wrote:
> > First off, you should not be using orbit from more than one thread.
> > It's a single-threaded system.
> > Orbit's multithread support is not ready yet.  (Or so I gather.)
> 
> Ah, ok. I wasn't sure about that. You think ORBit-mt could solve my problems then?

It wants to.  I've never used it, and I suspect others here are
saying it's stale, so don't count on it.

> > Second, there's no particular reason to have one thread for
> > your client and a different thread for your server; can't you
> > run both in the same thread?
> 
> How?? My ORBit server finishes with CORBA_ORB_run which never returns. Therefore to
> carry on doing any work you surely need to do so in a separate thread?

Easy: don't call CORBA_ORB_run.  Instead, use the work_pending() and
perform_work() methods (that's from the C++ binding; I suppose in C
they're called CORBA_ORB_work_pending() and CORBA_ORB_perform_work().

They *do* return, so you can do it all from a single thread.
Mind you, I haven't done this in Orbit, but it ought to be there;
it's part of the standard.   See chapter 11.11 of Henning & Vinoski.

- Dan



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