Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the ConcurrentOrderedMap. #6

Merged
merged 1 commit into from Mar 29, 2015

Conversation

buckett
Copy link
Contributor

@buckett buckett commented Mar 29, 2015

The reasons for removing it are:

  • It loses the performance characteristics of ConcurrentHashMap as it
    has an internal Vector which limits it's concurrency.
  • #putIfAbsent(K, V) isn't thread safe. It calls containsKey and then
    put, but doesn't do it atomically so it's not deterministic.
  • #remove(key, value) isn't thread safe. It removes the entry from the
    ConcurrentHashMap and then removes it from the internal Vector without
    any locking (another thread could be adding in between this).

The reasons for removing it are:
- It loses the performance characteristics of ConcurrentHashMap as it
has an internal Vector which limits it's concurrency.
- #putIfAbsent(K, V) isn't thread safe. It calls containsKey and then
put, but doesn't do it atomically so it's not deterministic.
- #remove(key, value) isn't thread safe. It removes the entry from the
ConcurrentHashMap and then removes it from the internal Vector without
any locking (another thread could be adding in between this).
azeckoski added a commit that referenced this pull request Mar 29, 2015
Remove the ConcurrentOrderedMap.
@azeckoski azeckoski merged commit cc0242c into azeckoski:master Mar 29, 2015
@azeckoski
Copy link
Owner

This was taken directly from a set of spring utilities so I have no problem dropping it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants