[omniORB] spawn a server from a server part 2

Sai-Lai Lo S.Lo@orl.co.uk
26 Jan 1999 16:40:34 +0000


>>>>> Rusty Carruth writes:

>> 
>> Are there any mechanisms in omniORB to block all threads for this
>> very little time, so I've time to close the fds?
>> 
>> What is the general way to spawn a new omniORB server process from   
>> another
>> server process ??????

> we use fork1, which only forks the current thread.  If your OS has
> that, then the only thing you have to worry about is the deadlock you
> can get into if you are printing in a thread which is not copied,
> and then you try to print in the forked thread - you cannot print because
> that other (non-existant) thread has the print resources locked, and
> since it does not exist, it will never get back around to release them
> (it?) for you.  So, if you do fork1 (under Solaris, anyway), don't follow
> it with a printf unless you are certain that no other thread will ever
> be printf'ing when the fork1 happens...

> The above is for Solaris 2.5.1, anyway.  YMMV.

I think as Rusty points out, the way to spawn a new server process is quite
OS dependent. In particular, does the OS recreate all the threads in the
child? I'm not sure if all the different flavours of Unix behave in the
same way and if it is possible to write generic code that works on all
platforms. 

If you find a sure way that works on a specific platform, do share with us
on this list.

Sai-Lai

-- 
Dr. Sai-Lai Lo                          |       Research Scientist
                                        |
E-mail:         S.Lo@orl.co.uk          |       Olivetti & Oracle Research Lab
                                        |       24a Trumpington Street
Tel:            +44 223 343000          |       Cambridge CB2 1QA
Fax:            +44 223 313542          |       ENGLAND