Message330830
| Author |
vstinner |
| Recipients |
benjamin.peterson, gregory.p.smith, izbyshev, miss-islington, pitrou, serhiy.storchaka, siddhesh, skrah, steve.dower, vstinner |
| Date |
2018年11月30日.22:53:05 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1543618385.35.0.788709270274.issue33015@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> why was that only an issue on 2.7?
I added PyMem_RawMalloc() to Python 3.4 and this function must be thread-safe.
https://docs.python.org/dev/c-api/memory.html#raw-memory-interface
"These functions are thread-safe, the GIL does not need to be held."
I replaced PyMem_RawMalloc() with PyMem_Malloc() when I backported the change, but I didn't know that PyMem_Malloc() isn't thread-safe *in debug mode*!
Gregory: do you think that it would be be crazy to fix PyMem_Malloc() to make it thread-safe in debug mode as well? I implemented a fix: PR 10828. |
|