Uploaded image for project: 'Commons JCS'
  1. Commons JCS
  2. JCS-119

replace synchronized blocks by java locks or concurrenhashmap

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • jcs-3.0
    • None
    • None

    Description

      A cache is typically used in a concurrent environment. Since Java 6 using a ReentrantLock is faster than synchronized so can be interesting to replace synchronized blocks by a lock.

      Places i'm thinking about:

      • CompositeCache
      • AbstractDoubleLinkedListMemoryCache
      • LHMLRUMemoryCache
      • DoubleLinkedList
      • LRUMap
      • SingleLinkedList
      • SortedPreferentialArray

      Some places where replacing a HashMap by a ConcurrentHashMap can allow to get rid of synchronized without needing a lock:

      • CacheEventQueue
      • AbstractDiskCache
      • CacheWatchRepairable

      There are other places but this is the main I saw.

      Attachments

        Activity

          People

            tv Thomas Vandahl
            romain.manni-bucau Romain Manni-Bucau
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: