I have a very multithreaded Python3 app I'm running which I have a whole bunch of calls to print() in. I don't generally do multithreading, but this is spinning up a whole bunch of servers to check if they're working right. I have another test which is non-multithreaded and reproducible, and will of course have another test of actually running
(
Read more... )
Comments 4
I've definitely seen this happen with fork, but I'm not positive it should happen with threads.
Reply
sys.stdout in Python 3.0 (based on runtime inspection) is a TextIOWrapper. I don't see any synchronization going on in io.py, which is what I would expect.
As far as I can tell this behavior is expected.
(I didn't find where print() itself is defined, though any thread-safety added there would not jive well with other uses of stdout anyway.)
Reply
Reply
Reply
Leave a comment