[omniORB] SINGLE_THREAD_MODEL and in-process calls

Duncan Grisby duncan at grisby.org
Tue May 10 21:49:49 BST 2005


On Tuesday 10 May, Alex Tingle wrote:

> Using a lock ensures that there is no concurrency, but I can imagine
> circumstances where this solution could still trap the unwary: Imagine a
> servant method that locks a mutex and another that unlocks it. The naive
> developer would assume that this would be safe in a SINGLE_THREAD_MODEL
> POA.

That developer would be extremely naive, since they would be at the
mercy of clients and the network not to ruin their locking.

> I imagine that the MAIN_THREAD_MODEL works in the same way. So there is
> NO WAY to guarantee that all calls are running in the same thread. I'll
> have to remember that.

No, the MAIN_THREAD_MODEL does what it says -- all calls are dispatched
on a single main thread. You have to give the ORB the main thread with
orb->run() or perform_work(). See section 4.5.1 of the omniORB manual:

  http://omniorb.sourceforge.net/omni40/omniORB/omniORB004.html

Cheers,

Duncan.

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



More information about the omniORB-list mailing list