C#, is there such a thing as a “thread-safe” stream?

前端 未结 3 1179
失恋的感觉
失恋的感觉 2020-12-20 14:43

I am redirecting the output of a process into a streamreader which I read later. My problem is I am using multiple threads which SHOULD have separate instances of this strea

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-20 15:21

    A 'thread-safe' stream doesn't really mean anything. If the stream is somehow shared you must define on what level synchronization/sharing can take place. This in terms of the data packets (messages or records) and their allowed/required ordering.

提交回复
热议问题