[Python-Dev] bytearray and array.array are not thread-safe (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Sat Jul 5 21:10:37 CEST 2008
- Previous message: [Python-Dev] C99 code in the Python core?
- Next message: [Python-Dev] bytearray and array.array are not thread-safe
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
Short story: bytearray and array.array by construction allow user code to reallocate their internal memory buffer. But a raw pointer to the said buffer can also be obtained by another thread, and used after releasing the GIL (for CPU-intensive operations like compression). As a consequence, the interpreter crashes.
Was it envisioned? I see no warning in the docs for the array.array type (although it has been there for quite some time).
See http://bugs.python.org/issue3139 (reported by Amaury)
Regards
Antoine.
- Previous message: [Python-Dev] C99 code in the Python core?
- Next message: [Python-Dev] bytearray and array.array are not thread-safe
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]