[omniORB] outScavenger kill

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


>>>>> Renzo Tomaselli writes:

> Hi, we experienced a problem with Visual Basic managing an OCX which
> links to an OmniORB related implementation. When switching from design
> mode to run mode and the contrary, Visual Basic crashes because DLLs are
> unloaded from memory, while the outScavenger thread is still alive. When
> the timer wakes it up, there is no loaded code to run and everything
> blows up.  We cannot understand how VB unloads depending modules while
> active threads are still alive (it doesn't happen with VC).  Anyway, the
> problem is that killOutScavenger is never called from OmniORB code; also
> there is no explicit ORB shutdown to call when all things are going to
> die.  

> From the BOA point of view there are impl_is_ready/impl_shutdown
> entry points which do the correct job for inScavenger, so everythings
> works fine there.  What about explicitely calling killOutScavenger from a
> key application destructor when things go down ?  Thanks, Renzo Tomaselli

Renzo,

As you have found out, outScavenger is never stopped. We may be able to do
a call to killOutScavenger and killInScavenger in the dtor of a global so
it will be called when main() returns. For instance, something like this in
scavenger.cc


class scavengerCleaner {
public: 
  ~scavengerCleaner();
  static scavengerCleaner theInstance;
};

scavengerCleaner scavnegerCleaner::theInstance;

scavengerCleaner::~scavengerCleaner()
{
   StrandScavenger::killInScavenger();
   StrandScavenger::killOutScavenger();
}

Please try this out.

Of course, there could still be a number of client threads created by 
the applications. I suppose these can be left to the application to do
something about it.

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