Author vstinner
Recipients eric.snow, ncoghlan, petr.viktorin, shihai1991, vstinner
Date 2020-01-30.11:35:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580384123.04.0.474591840811.issue39465@roundup.psfhosted.org>
In-reply-to
Content
Once I discussed with Eric Snow during a core developer sprint: _Py_IDENTIFIER() should use an "interpreter local storage" for identifiers values. _Py_IDENTIFIER() would only be a "key" and _PyUnicode_FromId() would store the value somewhere in a hash table stored in PyInterpreterState. Something similar to the TSS API:

* PyThread_create_key()
* PyThread_delete_key_value()
* PyThread_set_key_value()
* PyThread_get_key_value()

But per interpreter, rather than being per thread.

The key can be simply the variable address in memory. It only has to be unique in the process.
History
Date User Action Args
2020-01-30 11:35:23vstinnersetrecipients: + vstinner, ncoghlan, petr.viktorin, eric.snow, shihai1991
2020-01-30 11:35:23vstinnersetmessageid: <1580384123.04.0.474591840811.issue39465@roundup.psfhosted.org>
2020-01-30 11:35:23vstinnerlinkissue39465 messages
2020-01-30 11:35:22vstinnercreate