Closed chrisjbillington closed 10 years ago
Original comment by Chris Billington (Bitbucket: 557058:cbf1bc43-1dc2-477b-9e25-1a8f40fd7ee3, GitHub: cbillington).
Resolves Issue #1: Standard output and standard error redirecting out of sync. Both streams now share a socket when being written to from the same thread.
Original report by Chris Billington (Bitbucket: 557058:cbf1bc43-1dc2-477b-9e25-1a8f40fd7ee3, GitHub: cbillington).
When standard output and standard error are being rapidly printed to, they can become out of sync when both being redirected to the same target.
Both redirectors should use the same zmq socket (in each thread) for pushing output so that within each thread output is in the order it was produced. This means the threading.local object of each redirector need to share references to sockets, but we still will not have sockets being shared by threads.
Perhaps even we should have a single class to redirect all output (or either stream, settable via initialisation arguments), rather than two separate ones.