R
Richard Maher
Hi,
I'm sure I asked a similar question here before but couldn't find it -
sorry.
Can someone please confirm that for a given Socket with a
BufferedInputStream "in" and a BufferedOutputStream "out", I can have one
thread T1 executing a series of out.write()s followed by an out.flush()
without explicit locking or synchronizing that will in noway interfere with
another Thread T2 that is happily performing one (or more until we get "n"
bytes) in.reads?
IOW, one T1 is sending messages as it likes to a remote server and T2 is
processing the response messages. I want this all to happen in parallel and
without explicit thread-synching or lock/mutexing. Is that architecturally
sound given the classes that I am using?
Cheers Richard Maher
PS. For the sake of argument please assume that T1 is sending random numbers
and T2 is just doing System.out.println() i.e pretend the reader and writer
are completely independent.
I'm sure I asked a similar question here before but couldn't find it -
sorry.
Can someone please confirm that for a given Socket with a
BufferedInputStream "in" and a BufferedOutputStream "out", I can have one
thread T1 executing a series of out.write()s followed by an out.flush()
without explicit locking or synchronizing that will in noway interfere with
another Thread T2 that is happily performing one (or more until we get "n"
bytes) in.reads?
IOW, one T1 is sending messages as it likes to a remote server and T2 is
processing the response messages. I want this all to happen in parallel and
without explicit thread-synching or lock/mutexing. Is that architecturally
sound given the classes that I am using?
Cheers Richard Maher
PS. For the sake of argument please assume that T1 is sending random numbers
and T2 is just doing System.out.println() i.e pretend the reader and writer
are completely independent.