jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
castor
  • castor
  • CASTOR-2940 Replace Hashtable and synchronized Ha...
  • CASTOR-3158

Improve synchronization/locking at hashbelt cache

  • Log In
  • Views
    • XML
    • Word
    • Printable

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
  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    patch-C3158-20110727.txt
    26/Jul/11 10:22 PM
    15 kB
    Wensheng Dou

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Wensheng Dou added a comment - 26/Jul/11 10:22 PM

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

Show
Wensheng Dou added a comment - 26/Jul/11 10:22 PM In this patch, I make some slight changes to hashbelt cache.
Hide
Permalink
Wensheng Dou added a comment - 26/Jul/11 10:30 PM

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 - 26/Jul/11 10:30 PM 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
Vote (0)
Watch (0)

Dates

  • Created:
    26/Jul/11 10:19 PM
    Updated:
    28/Jul/11 1:41 PM
    Resolved:
    28/Jul/11 1:41 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.