Details

    • Type: Sub-task Sub-task
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.2
    • Fix Version/s: 1.3.3rc1
    • Component/s: JDO
    • Labels:
      None
    • Number of attachments :
      1

      Activity

      Hide
      Wensheng Dou added a comment -

      In this patch, I make some slight changes to hashbelt cache.

      Show
      Wensheng Dou added a comment - In this patch, I make some slight changes to hashbelt cache.
      Hide
      Wensheng Dou added a comment -

      After some investigations, I find that the Container (FastIteratingContainer and MapContainer) could be protected properly by AbstractHashbelt.lock(). Because we can't access the Container directly, we just access the Container through AbstractHashbelt, so the AbstractHashbelt.lock() will protect the Container. So I think the synchronized/locking on the Container (FastIteratingContainer and MapContainer) is not necessary.

      But the AbstractHashbelt.lock() can't protect WeakReferenceContainer properly, because WeakReferenceContainer.get need to get the writeLock, this has different meaning with AbstractHashbelt.lock(). So synchronized/locking on WeakReferenceContainer is necessary.

      Is there something wrong with this comment?

      Show
      Wensheng Dou added a comment - After some investigations, I find that the Container (FastIteratingContainer and MapContainer) could be protected properly by AbstractHashbelt.lock(). Because we can't access the Container directly, we just access the Container through AbstractHashbelt, so the AbstractHashbelt.lock() will protect the Container. So I think the synchronized/locking on the Container (FastIteratingContainer and MapContainer) is not necessary. But the AbstractHashbelt.lock() can't protect WeakReferenceContainer properly, because WeakReferenceContainer.get need to get the writeLock, this has different meaning with AbstractHashbelt.lock(). So synchronized/locking on WeakReferenceContainer is necessary. Is there something wrong with this comment?

        People

        • Assignee:
          Wensheng Dou
          Reporter:
          Wensheng Dou
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: