[omniORB] Shutdown

David Riddoch djr@uk.research.att.com
Wed, 6 Sep 2000 11:58:51 +0100 (BST)


Hi Mark,


ORB->shutdown() does not let you set a return value, because it does not
cause the process to exit.  You do that as normal by calling exit() or
returning from main().

You have a number of choices.  You can do it in the main thread:

  sleep(a_while);
  orb->shutdown(1);
  orb->destroy();
  exit(2);

Or you can block in the main thread, and trigger the shutdown from a CORBA
request (or another thread) ...

In the main thread:

  orb->run();
  orb->destroy();
  exit(2);

In the CORBA request (or async thread):

  orb->shutdown(0);


Hope that helps,
David


On Wed, 6 Sep 2000, Dr Mark D Spiteri wrote:

> We'd like to profile a Linux multi-threaded application that also
> implements/provides two CORBA server interfaces, and of course to use gprof
> one needs to have the application exit with 2 as the return value. Ideally
> I'd like to be able to trigger shutdown through a CORBA interface, or,
> failing that, after some kind of timeout.
> 
> Does OmniORB (2.8.0/3.0.1) provide any customary timeout shutdown method as
> suggested in the Vinoski book? I know about ORB->shutdown() in the POA but I
> understand that this does not allow you to set the return value. Are there
> any abstractions provided in OmniORB to support signal-initiated shutdown?
> 
> Any advice appreciated.
> 
> Thanks
> Mark