The println methods in class PrintStream
are not all synchronized. The result is that
if two threads try to simultaneously
use println() you can sometimes end up with another print printing
between the first part of the string and the newline character.
The bad output looks like this:
Done reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gif
Done reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gif
are not all synchronized. The result is that
if two threads try to simultaneously
use println() you can sometimes end up with another print printing
between the first part of the string and the newline character.
The bad output looks like this:
Done reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gif
Done reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gifD
one reading http://tachyon/~csw/graphics/csw.gif