J
Jeremy
Well, just one question, primarily.
Consider the following scenario: Two threads are running in parallel. Each
thread has called System.setOut(PrintStream myOut) to redirect output from
its own printstream ("myOut") to the output. So what happens when thread A
writes to its System.out, and what happens when thread B writes to
System.out? To which thread's "myOut" does the output go? I assume that
the last thread to call System.setOut will get all everything to its myOut,
but that hardly seems fair to the first thread?
This situation should really never matter, but in my situation it does
Also, it is an interesting question - System resources are not thread-safe
and could be hijacked by another thread.
And I guess the question is, is there a way to give different threads their
own System.out, such that they can write to System.out and be able to
predict where it is going?
Thanks,
-Jeremy
Consider the following scenario: Two threads are running in parallel. Each
thread has called System.setOut(PrintStream myOut) to redirect output from
its own printstream ("myOut") to the output. So what happens when thread A
writes to its System.out, and what happens when thread B writes to
System.out? To which thread's "myOut" does the output go? I assume that
the last thread to call System.setOut will get all everything to its myOut,
but that hardly seems fair to the first thread?
This situation should really never matter, but in my situation it does
Also, it is an interesting question - System resources are not thread-safe
and could be hijacked by another thread.
And I guess the question is, is there a way to give different threads their
own System.out, such that they can write to System.out and be able to
predict where it is going?
Thanks,
-Jeremy