[omniORB] maybe an omniORB designer knows

David.Chung@USPTO.GOV David.Chung@USPTO.GOV
Thu, 24 Jun 1999 09:45:24 -0400


	This question is regarding a programming technique.  I am thinking
that the technique I need may have been used in omniORB's design, and I
would
be grateful for any information about it.

	Specifically, I want to do the following PRIOR to the entry of
main(), 

(1) create a number of global static objects and 
(2) then force the execution of a function that will operate on the static
objects.
The function does not have the address of each global static object.
before the creation of each object.  It only has the address of a global 
linked list for holding those objects.  The function should be executed
only once.

	When my program starts, the constructor for each object will check
if it has
been inserted into a global linked list..  After ALL of my objects have been
created
and inserted into the global linked list, the function should then be called
to 
operate on the objects.

	Note that the function must wait until ALL objects have been created
and inserted into the linked list -- otherwise, I would miss some objects
that should be operated on by the function.

	So, here is the question: how in the world can I make sure that
the function gets triggered AFTER all the static global objects have been
created
and inserted into the linked list?  (Remember, the function does not have
the 
address of each object prior to their creation -- it only has address of the
linked
list into which the object is to be inserted).

	I was thinking that, in designing omniORB, perhaps one had to deal
with similar problems.
	
	One solution I was thinking about involves creating and running a
separate thread before the entry of main().
Is there a way to create a separate thread and have it run prior to the
entry of main()?