[omniORB] thread-sync issue on shutdown
Duncan Grisby
dgrisby@uk.research.att.com
Fri, 04 May 2001 11:48:33 +0100
On Thursday 3 May, henning.schmidt@philips.com wrote:
> Since I am still building up my code I am currently not doing
> anything with <myObj>. Instead I delete the ORB immediatley after
> the above lines.
[...]
> Now here's the thing: Every once in a while (roughly one out of two
> times) thread (B) does not arrive at point (b). Instead thread (A)
> catches <CORBA::BAD_INV_ORDER> in my above catch-block. But I also
> found a workaround: I can avoid the exception by letting thread (B)
> sleep for some time (e.g. 1 second) at point (a).
Surely the problem is just a race between the two threads. Thread B
manages to get to orb->shutdown() before thread A executes
orb->run(). run() therefore properly throws BAD_INV_ORDER because
you're calling run() on a shutdown ORB.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --