[omniORB] FW: Where to place ORB->run() in multithreaded applications

Duncan Grisby dgrisby@uk.research.att.com
Mon, 20 Nov 2000 10:48:44 +0000


On Thursday 16 November, "ERIKSSON,TOBIAS (A-Sweden,ex1)" wrote:

>  I'm struggling with some problems, where I when the system is brought down
> gives me a SIGABRT (signal 6). This all happens when I do ORB->shutdown() in
> one of my threads, from the stack trace I see that it does alot of stuff to
> bring the ORB and POA down. I always end up at the same location when it
> fails, however it does not fail every time, perhaps every 8:th time. 
> The stacktrace is below.
>  Anyway I read in "Advanced CORBA programming in C++" Henning Vinoski, that
> sometimes depending on the implementation of the ORB etc one has to let the
> main-thread execute the ORB->run().  I however, made a new thread that
> executes the ORB->run() call. 

In omniORB, you don't actually need to call orb->run() at all, so it
doesn't matter which threads you call it in. That isn't the cause of
your crash. I don't know how it can be dying inside a pthread
function, unless you're trying to use a mutex after it has been
destroyed. Are you using Linux?  If so, don't trust the core file you
get after an abort -- run the program inside gdb to see where it
really fails.

One option to avoid the abort is to just not call shutdown(). If you
just exit, the OS will clear everything up for you.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --