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 vstinner
Recipients amaury.forgeotdarc, christian.heimes, georg.brandl, kristjan.jonsson, ncoghlan, serhiy.storchaka, vstinner
Date 2013-06-13.22:07:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1371161223.07.0.0226419694161.issue18203@psf.upfronthosting.co.za>
In-reply-to
Content
>> We have to be careful with the GIL: PyMem_*() functions can only be
>> called when holding the GIL.

> (...)
> I think there's a potential problem here :)

I didn't understand the motivation to require the GIL held for PyMem_Malloc(). I searched in the source code history and on the Internet (archives of python-dev). In my opinion, the restiction is motivated by a bug: PyMem_Malloc() calls (indirectly) PyObject_Malloc() in debug mode, and PyObject_Malloc() is not thread-safe.

I opened a thread on python-dev to discuss this point.
History
Date User Action Args
2013-06-13 22:07:03vstinnersetrecipients: + vstinner, georg.brandl, amaury.forgeotdarc, ncoghlan, kristjan.jonsson, christian.heimes, serhiy.storchaka
2013-06-13 22:07:03vstinnersetmessageid: <1371161223.07.0.0226419694161.issue18203@psf.upfronthosting.co.za>
2013-06-13 22:07:03vstinnerlinkissue18203 messages
2013-06-13 22:07:02vstinnercreate