: From: Paul Fisher <[EMAIL PROTECTED]>
: Date: 27 Mar 1999 01:29:47 -0500
:
: "Jochen Hoenicke" <[EMAIL PROTECTED]> writes:
:
: > 1) For JDK-1.1.7 all Methods in BitSet except size() are synchronized.
: > 2) For JDK-1.2 no Method is synchronized.
:
: Is it possible that they're synchronizing on something other than the
: this instance, possibly a field?
I have written a second test, where one thread constantly xors a
bitset with another, while the the second thread uses toString() and
looks if the bitset has one of the two possible forms.
JDK1.2 doesn't synchronize; xor() and toString() aren't atomic.
(Luckily, jdk1.2 uses native threads, where such race conditions can
be easily provoked)
Jochen