Mailing List Archive

Buffer interface and multiple threads
Hmm, something that just struck me: the buffer _interface_ (i.e. the C
routines, not the buffer object stuff) is potentially thread-unsafe.

In the "old world", where "s#" only worked on string objects, you
could be sure that the C pointer returned remained valid as long as
you had a reference to the python string object in hand, as strings
are immutable.

In the "new world", where "s#" also works on, say, array objects, this
doesn't hold anymore. So, potentially, while one thread is in a
write() system call writing the contents of the array to a file
another thread could come in and change the data.

Is this a problem?
--
Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm