This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients Tamas.K, grahamd, jcea, ncoghlan, neologix, pitrou, python-dev, tim.peters
Date 2013-08-31.02:41:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Nasty problem ;-)

I don't understand the need for all the indirections in the second patch.  Like, why use a weakref?  It's not like we have to worry about an immortal tstate keeping a measly little lock object alive forever, right?  Seems to me that if the tstate object held the new lock directly, the tstate destructor could release the lock directly (and so also skip the new tstate->on_delete and tstate->on_delete_data indirections too).

Then again, I'd settle for Py_EndInterpreter simply sleeping for a second and trying again when it finds "another thread" hanging around (effectively moving Tamas's sleep() into Py_EndInterpreter, but only sleeping if needed).  Yes, that's theoretically insecure.

But if we're worried about wildly improbable timing problems, then the patched code can appear not to honor a non-None Thread.join() `timeout` argument too.  That is, the first call to the new `pred()` can theoretically consume any amount of time, due to its self._tstate_lock.acquire().  The same kinds of timing implausibilities that could cause a short sleep to fail could also cause that acquire() to take "a long time" (maybe even 2 seconds - LOL).

But, ya, it's better to really fix it.
Date User Action Args
2013-08-31 02:41:02tim.peterssetrecipients: + tim.peters, jcea, ncoghlan, pitrou, grahamd, neologix, python-dev, Tamas.K
2013-08-31 02:41:02tim.peterssetmessageid: <>
2013-08-31 02:41:02tim.peterslinkissue18808 messages
2013-08-31 02:41:02tim.peterscreate