Doug Lea <dl@altair.cs.oswego.edu> writes:
> These results are very helpful. But to me, the most helpful
> numbers would be those comparing specJVM runs in which
> All String constructors and accessors are synchronized
> vs
> All String constructors and accessors use barriers as needed to
> preserve initialization safety
> vs
> current version of String
These are good experiments, and I will try them, but note that
option 1 (making all String constructors and accessors synchronized)
is not trivial. In particular, there are binary operators
(compareTo, equals, etc.) for which both strings involved need to
be locked, which can easily lead to the possibility of deadlock.
(This actually makes me wonder about the collection classes.
They have a number of binary operators too, and some of
the implementations can be synchronized using wrappers without
that fact being made known to either the clients, or the
implementors.)
-Sanjay
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:18 EDT