[Python-Dev] bytearray and array.array are not thread-safe (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Sun Jul 6 13:17:23 CEST 2008
- Previous message: [Python-Dev] bytearray and array.array are not thread-safe
- Next message: [Python-Dev] bytearray and array.array are not thread-safe
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Le dimanche 06 juillet 2008 à 00:28 +0200, "Martin v. Löwis" a écrit :
I propose that new codes s*, t*, w* are added, and that s#,t#,w# refuses objects which implement a releasebuffer procedure (alternatively, s# etc might be removed altogether right away). Users of s* then need to pass in a PyBuffer view pointer that gets filled, and need to explicitly release the buffer. For convenience, it might help if the Pybuffer structure includes a borrowed PyObject* to the underlying object, along with a PyBufferRelease procedure/macro.
Why a borrowed reference rather than a new one? It could be decref'ed as part as the proposed PyBuffer_Release procedure.
Overall it sounds like a clean resolution of the problem.
Regards
Antoine.
- Previous message: [Python-Dev] bytearray and array.array are not thread-safe
- Next message: [Python-Dev] bytearray and array.array are not thread-safe
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]