[omniORB] Proper way for orderly server process shutdown?

David Riddoch djr@uk.research.att.com
Tue, 13 Jul 1999 09:07:46 +0100 (GMT)


On Mon, 12 Jul 1999, Ken Feuerman wrote:

> Not so sure this is quite the right way to go.  I'd be concerned about a
> race condition where the shutdown_thread_fn() actually executes and
> completes prior to the shutdown_orb()'s call stack unwinding.  For example,
> what would happen if shutdown_thread_fn() executed in its entirety while
> shutdown_orb() was pre-empted right after the new omni_thread call, but
> before fully leaving the function?

No problem.  The BOA::impl_shutdown() method blocks until all requests
have completed while it is shutting down the incoming Rope factories.
Thus we may make some progress in the shutdown before shutdown_orb()
completes, but it will then block, shutdown_orb() will then complete, and
only then can the shutdown complete.

At that point the main thread will return from BOA::impl_is_ready(), and
can call BOA::destroy().


David