[omniORB] Proper way for orderly server process shutdown?

Wil_Evers@doosys.com Wil_Evers@doosys.com
Mon, 12 Jul 1999 12:12:14 GMT


Hello Sai-Lai,

You wrote:

> Alright, I removed the non-deterministic behaviour and now all server
> threads is guaranteed to have exited before BOA::destroy() returns.

> Could you try to see if this help?

I applied your patch and tested the following scenarios :

- Block the main thread with boa->impl_is_ready(), have the receiving
"root" object implementation call boa->impl_shutdown() from its shutdown
method, and finally, have the main thread dispose the receiving object and
call boa->destroy().
- Have the main thread call boa->impl_is_ready (0, 1), and then block it on
a semaphore.  The receiving "root" object disposes itself from its shutdown
() method.  This eventually results in a call to its destructor, which
signals the semaphore, unblocking the main thread.  Finally, the main
thread calls boa->impl_shutdown() and then boa->destroy().  (I did this
because I don't like oneway calls).

I tested both scenarios on RedHat Linux 5.2 (enhanced with egcs 1.1.2, but
still using glibc 2.0), and RedHat Linux 6.0 (with comes with egcs 1.1.2
and glibc 2.1).  Everything worked as expected, there were no deadlocks or
coredumps.

Just try to get that level of support from any commercial ORB vendor...
Thank you very much!

By the way, there is a comment in CORBA.h saying one shouldn't call
boa->impl_shutdown() from an interface implementation.  I take it that only
applies to boa->destroy()?

Regards,

- Wil

Wil Evers, DOOSYS IT Consultants, Maarssen, Holland