According to Josh Bloch, ThreadLocal uses a special-purpose IdentityHashMap
in 1.4, and is even faster.
----- Original Message -----
From: "David Holmes" <dholmes@dstc.edu.au>
Sent: Monday, February 26, 2001 6:17 PM
Subject: RE: JavaMemoryModel: Immutablity and Final Fields
> > I wonder how the overhead of ThreadLocal compares to either
> > a synchronized accessor or a volatile reference. ;-)
It's an unsynchronized HashMap as of JDK 1.3. So maybe the overhead
is not that significant.
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:30 EDT