[GitHub] activemq-artemis pull request #1851: ARTEMIS-1664 fix npe bug while getting ...

2018-02-23 Thread wy96f
Github user wy96f closed the pull request at:

https://github.com/apache/activemq-artemis/pull/1851


---


[GitHub] activemq-artemis pull request #1851: ARTEMIS-1664 fix npe bug while getting ...

2018-02-23 Thread franz1981
Github user franz1981 commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/1851#discussion_r170185326
  
--- Diff: 
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashMap.java
 ---
@@ -457,11 +459,11 @@ private void rehash() {
 }
  }
 
- capacity = newCapacity;
  keys = newKeys;
  values = newValues;
  usedBuckets = size;
- resizeThreshold = (int) (capacity * MapFillFactor);
+ capacityUpdater.lazySet(this, newCapacity);
+ resizeThreshold = (int) (newCapacity * MapFillFactor);
--- End diff --

`capacityUpdater.lazySet` is store-releasing `keys` , `values`, 
`usedBuckets`, but not `resizeThreshold`: that means that the `resizeThreshold` 
store could be happen before the update of the `capacity`, is it correct?



---


[GitHub] activemq-artemis pull request #1851: ARTEMIS-1664 fix npe bug while getting ...

2018-02-06 Thread franz1981
Github user franz1981 commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/1851#discussion_r166307381
  
--- Diff: 
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashMap.java
 ---
@@ -457,10 +457,10 @@ private void rehash() {
 }
  }
 
- capacity = newCapacity;
  keys = newKeys;
  values = newValues;
  usedBuckets = size;
+ capacity = newCapacity;
--- End diff --

Please check if is possible to use a lazySet too (maybe with an 
`AtomicFieldUpdater` or similar) to write release the keys/values in order to 
avoid a full barrier


---