[issue3476] BufferedWriter not thread-safe

Antoine Pitrou report at bugs.python.org
Thu Jul 31 16:36:17 CEST 2008


Antoine Pitrou <pitrou at free.fr> added the comment:

Selon Benjamin Peterson <report at bugs.python.org>:
>
> Benjamin Peterson <musiccomposition at gmail.com> added the comment:
>
> It seems that as with the quadratic binary buffered reading, the best
> solution is the list of bytes which should be especially helped by your
> bytes joining optimization.

I don't really know. The logic is quite different (and harder to get right) than
in BufferedReader. I might try to write a list-of-bytes version and do some
timings, but it's not trivial... I should first compare against the current
version.

Also, an advantage of using a fixed-size bytearray is that it more closely
mimicks what will have to be written for an efficient C implementation.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3476>
_______________________________________


More information about the Python-bugs-list mailing list