[omniORB] ORB thread init without static object

Duncan Grisby duncan at grisby.org
Fri Mar 5 17:14:00 GMT 2004


On Wednesday 3 March, "Michael Shearer" wrote:

> Is there a way to explicitly initialize the omniORB thread without
> having to rely on the static object 'omni_thread_init' to construct it? 
> The reason is that I'm using a framework which all my servers/clients
> inherit from which also uses static objects to initialize certain
> classes prior to the main() being called.  Some of these classes require
> that the ORB be running before they can be initialized.  Depending where
> the objects are initialized or what the compiler/linker did with them,
> the order in which they are initialized is somewhat random.  Hence I'm
> stuck in a catch 22.  As a workaround, I'm using GNU specific attributes
> to change the order in which the static objects are being initialized:
> __attribute ((init_priority(X))).  However I'd like to use a more
> generic approach.  Any recommendations?

There are all sort of static objects that must be initialised before
ORB_init() is called, not just the omni_thread_init objects that
initialise the thread library. I afraid I don't think there will ever
be a way of safely running ORB_init() at static initialiser time.

Cheers,

Duncan.

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



More information about the omniORB-list mailing list