mixed threading creates an exception

Daniel Popowich popowich@sovereign-hill.com
Fri, 30 Jan 1998 14:00:11 -0500 (EST)


I'm using omniORB to serve up some legacy code that uses a threading
package from ObjectSpace.  ObjectSpace's thread class os_thread, like
omni_thread, encapsulates underlying native threading in a
cross-platform, simple-to-use class.

I have run into a problem on NT4.0 when calling impl_shutdown() on a
CORBA::BOA_ptr when the method is called from a thread created by
os_thread.  In other words, if boa->impl_shutdown is NOT called from
the main thread, or a thread generated by omnithread I get an
exception thrown in omni_thread::self() (src/lib/omnithread/nt.cc).
The trace is as follows:

    CORBA::BOA::impl_shutdown()
    StrandScavanger::killInScavanger()
    omni_thread::join()
    omni_thread::self()

I do NOT have this problem on Solaris.  Exact same code, call
boa->impl_shutdown() from an ObjectSpace thread and I have no
problems.  This problem only exists on NT.

What seems particularly frustrating is that both ObjectSpace and
omnithread appear to be using the exact same underlying win32 native
threading.  

Has anyone else seen similar behaviour?  Is this a bug?  Any
suggestions (except suggesting rewriting my legacy code using
omnithread) on how to resolve this will be appreciated.

I'm using omniORB 2.4 on NT4.0 (x86) and Solaris 2.5 (sparc).

Thanks,

-------------------------------------------------------------------
Daniel Popowich                  email: popowich@sovereign-hill.com
Sovereign Hill Software, Inc.    phone:              (413) 587-2228
100 Venture Way                    fax:              (413) 587-2246
Hadley, Massachusetts 01035   
-------------------------------------------------------------------