[omniORB] ORB::shutdown() within DLL at process shutdown on WinNT

Renzo Tomaselli renzo.tomaselli@tecnotp.it
Wed, 22 Nov 2000 09:58:15 +0100


Daniel,
I confirm my previous posting after many attempts to solve it. I experien=
ced
similar problems with my own threads created from inside any dll to be
loaded at runtime and there is no way to join them during dll unloading. =
On
the other hand, leaving them to sleep forever works well until process
quits; then they wake up and this creates a random fault since their
termination code is no longer available. The same occurs if threads are l=
eft
running out without joining them: a random fault is generated if they
terminate after the dll was unloaded.
The only solution I found is to put a thread factory inside the process m=
ain
code (not inside any dll) so that they have a safe place to die, as well =
as
to startup/shutdown ORB/BOA from main (or from any *implicitely* loaded
dll).
Hope this helps,
                                             Renzo Tomaselli
-------------------------------------------------------------------------=
--
TecnoTP s.n.c. Special Information System Design
Maso Pelauchi I38050 Ronchi Valsugana,  Trento TN  ITALY
Tel. +39 0461 773164      Fax. +39 0461 771514
e-mail: renzo.tomaselli@tecnotp.it
-------------------------------------------------------------------------=
--


-----Original Message-----
From: Daniel Bell <Daniel.Bell@colorbus.com.au>
To: 'omniorb-list@uk.research.att.com' <omniorb-list@uk.research.att.com>
Date: mercoled=EC 22 novembre 2000 04:50
Subject: [omniORB] ORB::shutdown() within DLL at process shutdown on WinN=
T


>Hi,
>
>I am having trouble with processes hanging within ORB::shutdown(), when =
the
>ORB::shutdown() is being called from a DLL at the time of process
detachment
>on WinNT. A similar problem was reported in
>http://www.uk.research.att.com/omniORB/archives/2000-03/0012.html (with =
no
>follow-up).
>
>In particular, I have a singleton class in the DLL which wraps a ORB_var
>object, and on destruction of the singleton object, the ORB::shutdown()
>function is called. The singleton is destructed at the time that the DLL=
 is
>informed of process detachment, and by this time, all the threads in the
>process _seem_ to have been killed (without a chance of executing any
>cleanup code). The call to ORB::shutdown() blocks because it is waiting =
for
>a worker thread to shutdown (it blocks on a semaphore), and that thread
>_appears_ to have already been killed by the operating system. Hence the
>process is essentially single threaded by this stage, and is blocked on =
a
>semaphore - a semaphore which will never be signalled.
>
>Is this a bug in omniORB? Or does anyone have any suggestions on how to
>avoid this scenario?
>
>Thanks,
>Daniel.
>
>- Daniel Bell
>- Software Engineer, Colorbus Pty Ltd
>- Email: daniel.bell@colorbus.com.au
>- Phone: 61 3 8574 8035
>- WWW:   http://www.colorbus.com
>