[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

Erik Bray report at bugs.python.org
Wed Aug 31 13:08:10 EDT 2016


Erik Bray added the comment:

Ah, I wasn't thinking clearly toward the bottom of my last message.  I see now that after a fork, _PyGILState_Reinit calls PyThread_delete_key followed by a new PyThread_create_key--in the current version of my patch that would result in putting the autoTLSkey at the end of the linked list, which is no good.  That could be worked around, but...

Ed's version looks good to me.  I had the same idea as an alternative, though was a little concerned with the possibility that the array could grow too large.  But as I wrote in my last message that would be an extreme case.  And regardless his version will at least maintain constant time, so +1.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25658>
_______________________________________


More information about the Python-bugs-list mailing list