Re: Re: [omniORB] omniORBpy deadlock / termination problem.
Duncan Grisby <[email protected]> Wed, 12 Nov 2003 12:26:43 +0000
| Newsgroups | gmane.comp.corba.omniorb.devel |
|---|---|
| Message-ID | <[email protected]> |
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 -- -- [email protected] -- -- http://www.grisby.org --