I have an instance of NamedPipeClientStream in my application that is configured for duplex communication (PipeDirection.InOut). I also have two streams, a read stream and a write stream.
I want the read stream to call only the NamedPipeClientStream.Read method, and the write stream only to call the NamedPipeClientStream.Write method. They will never call each other's methods, but they can simultaneously call the channel instance.
I looked at the documentation for NamedPipeClientStream and said that public static methods are thread safe, but instance methods do not guarantee thread safety.
My question is, how safe is it that I have two threads that call two different methods (read and write) in the channel instance at the same time or is this something that I should not do? Also, is the instance label thread stream applicable only to individual threads invoking the same method, and not to individual threads invoking individual methods, such as reading and writing?
Thank!
Chris source
share