[omniORB] Number of threads

Duncan Grisby duncan at grisby.org
Mon Mar 13 13:47:01 GMT 2006


On Thursday 9 March, Olivier Chedru wrote:

> Is there a way to tell omniORB to use a fixed number of threads on the
> server side?

Not exactly. However, you can make it so that the threads omniORB
creates are never stopped. If a thread is idle, it stays alive for
omniAsyncInvoker::idle_timeout seconds, before being stopped. If you
just set that to a very large number before you call ORB_init(), threads
will not exit once they are started.

If you really need to pre-create all the threads you're going to have,
you can define a Task class that blocks until you broadcast on a
condition variable, then insert lots of task instances to the invoker
before signalling them to wake them up. That way, you will trigger
creation of lots of threads in the invoker, and they won't go away
because you've set the timeout.

Cheers,

Duncan.

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



More information about the omniORB-list mailing list