Erik Bray added the comment:

Here's a first stab at a patch for this.  A linked list is maintained which 
maps pthread_key_t instances to an int "key_id" that is used for the PyThread 
API.  Each function needs to map a given key_id to the actual pthread_key_t.  
This adds a little bit of overhead of course, but in typical usage I don't 
think there are many entries in this list to loop over.

This also reverts the change from #22206 which is no longer relevant.  No 
synchronization is provided for PyThread_create_key and PyThread_delete_key, 
but in typical usage that would be the user's responsibility anyways.  
Otherwise every PyThread_*_key function would have to have a mutex around it.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue25658>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to