[omniORB] One more multi-thread question

Duncan Grisby duncan at grisby.org
Thu Jan 10 15:16:16 GMT 2008


On Wednesday 2 January, "Luo Yongheng" wrote:

> I use multi-thread mode on server side.

omniORB is always multi-threaded. You can't choose not to be
multi-threaded. You can only choose between different ways of allocating
threads, not to avoid using threads altogether.

> Assume that we have one servant
> incarnated, does that mean all running threads/tasks enters the same
> memory/code area of the servant in the main process? since all the
> threads/tasks share the same memory image of the main process.

Yes.

> Futhre, if we incarnate one more servant whose implementation is the
> same as the previous one, does that still mean all threads/tasks enters
> the same memory area as previous one? Because functions of different
> objects of the same class just shares the same memory area, and the only
> difference is the implicit 'this' pointer passed as the parameter.

If you incarnate another servant, it will correspond to a different
CORBA object. If all the client calls are to the first CORBA object, all
the calls will be handled by the first servant, and the second servant
will be ignored.

> So can we conclude that incarnating more than one servants of the same
> implementation class does not help improve the multi-thread efficiency?

No. I think you are imagining some kind of link between servants and
threads. There isn't any relationship between them. CORBA objects can
map to servants in various ways, depending on the POA setup, but
threading never comes into it.

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list