Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

> Well, if that resolution is prefered, I think it should be integrated to
> the builtin print function, rather than forcing users to monkeypatch it
> (but a debugging facility directly calling sys.stdout.write or
> equivalent will not be helped).

True. I think it is the stream's write method that must be
synchronized, e.g. by renaming the current write function to
_write_locked, and adding a write function that obtains a per-file
lock, and calls write_locked. Other methods accessing the buffer
need to get synchronized with the same lock as well.

This is how it's done in about any stdio implementation I ever looked at.

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3476>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to