Message300948
>>> I fixed Python 3, no?
Yes. In Python3 they are replaced by PyMem_RawMalloc. But it's not only PyMem_Malloc, there are also PyErr_SetString, PyErr_NoMemory, even in Python3.
BTW, even in Python3, when memory allocators are in debug mode, it finally calls bumpserialno, which IIUC, is not thread safe. But of course it's another issue.
>>> For Python 2, in practice you can call PyMem_Malloc() without holding the GIL, it's just malloc() which is thread safe.
Hmm, I know it. But it's not stated in the doc they are thread safe, I am not sure assuming this is suitable. An example is https://github.com/psycopg/psycopg2/issues/110. |
|
Date |
User |
Action |
Args |
2017-08-28 10:28:41 | xiang.zhang | set | recipients:
+ xiang.zhang, vstinner, serhiy.storchaka |
2017-08-28 10:28:41 | xiang.zhang | set | messageid: <1503916121.06.0.180130167862.issue31282@psf.upfronthosting.co.za> |
2017-08-28 10:28:41 | xiang.zhang | link | issue31282 messages |
2017-08-28 10:28:40 | xiang.zhang | create | |
|