[omniORB] omniORBpy: destroy() call hangs after a fork

Duncan Grisby duncan at grisby.org
Wed Jun 1 12:08:06 BST 2005


On Monday 9 May, Forest Zachman wrote:

> I'm having some trouble using omniORB in python with code that forks.
> I'm sure it's some problem with the forked process getting a copy of
> the parents memory, but I'm not really sure what's going on here.
> Here's an example (based on the echo example):

The problem is that ORB_init creates some threads. orb.destroy() tries
to stop the threads. In your forked process, only the main thread is
copied, but it thinks it has the other threads. So, it's blocked waiting
for threads that don't exist to tell it that they have finished.

Basically, it's not safe to fork from a multi-threaded process unless
you immediately exec afterwards. Even that isn't safe on all platforms.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list