[Python-Dev] why duplicate output lines in verbose tests? (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Wed Aug 13 11:07:34 CEST 2008


Guido van Rossum <guido python.org> writes:

On Tue, Aug 12, 2008 at 11:32 AM, Bill Janssen <janssen parc.com> wrote: >> Is it using fork()? Threads? > > No on fork(), yes on threads. Hmm... I don't believe that io.py is thread-safe.

There is an issue open for the BufferedWriter + threads problem (which is probably what causes Bill's problem above). http://bugs.python.org/issue3476

As Martin suggested in this issue's comments, a simple fix would be to wrap most methods with an instance-specific mutex. I don't know how that would affect performance.

Regards

Antoine.



More information about the Python-Dev mailing list