[omniORB-dev] Re: [omniORB] omniORBpy deadlock / termination
problem.
Duncan Grisby
duncan at grisby.org
Wed Nov 12 12:26:43 GMT 2003
On Monday 13 October, Harri Pasanen wrote:
I've only just had a chance to look at this...
> 1. A shutdown method that is registered with Python's atexit module.
> This is required to properly close pyThreadCache, which needs to run
> Python code, so python still needs to be present. Otherwise it can
> be that when pyThreadCache is destructed at omniORB cleanup during
> process exit, the python interpreter has already gone.
How can that happen? The thread cache is only destroyed if
orb->destroy() is called. As long as that is called before process
exit time, I don't think there can be a problem. Can you explain a
situation where it is an issue?
Also, the atexit module was added in Python 2.0. omniORB needs to
support Python 1.5.2, so it can't be a general solution.
> 2. pyThreadCache join needs to be in python's ALLOW_THREADS macros,
> otherwise pyThreadCache cannot be shut down from a python method.
> (And the previous atexit change should ensure it is always called
> from a python method).
The thread cache is killed as part of orb->destroy(). The caller of
orb->destroy() should not be holding the Python interpreter lock.
> 3. pyThreadCache table mutex was split from thread kill mutex to
> optimize the thread killing, the former mutex being too long lived.
I don't understand that. Can you explain?
I'm afraid I still don't understand the problem. As far as I can see,
the problem you sent me is just that you are calling orb->destroy()
from a thread that is holding the Python interpreter lock.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan at grisby.org --
-- http://www.grisby.org --
More information about the omniORB-dev
mailing list