Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4252910

speed improvement for ThreadLocal.java

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.2.0
    • core-libs
    • generic
    • generic



      Name: ca25432 Date: 07/09/99


      The ThreadLocal class uses a collection that has a large
      granularity synchronization lock. This lock could be narrowed
      so that calls to get a ThreadLocal value are effecient.

      On a cursory glance ThreadLocal is used in String in the JDK
      for chartobyte encodings and has suggested uses for app
      developers. Here is the authors comments

      This class duplicates the functionality of
      java.lang.ThreadLocal with substantially improved performance.
      The speed of ThreadLocal.get is improved by a factor of 5 when using
      the classic VM and 2.5 when using HotSpot. The implementation of <i>get</i>
      only requires synchronization when a new entry is being created.
      @author Dr. Mark Thornton
      (Review ID: 85417)
      ======================================================================

            jjb Josh Bloch (Inactive)
            caustinsunw Calvin Austin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: