Skip to content

Commit 8f40495

Browse files
committed
switch to high-concurrency queue
1 parent 854212b commit 8f40495

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoderPool.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
package org.jlab.detector.decode;
22

3-
import java.util.concurrent.ArrayBlockingQueue;
3+
import java.util.concurrent.ConcurrentLinkedQueue;
44

55
/**
66
*
77
* @author baltzell
88
*/
99
public class CLASDecoderPool {
10-
11-
ArrayBlockingQueue<CLASDecoder> pool;
10+
11+
ConcurrentLinkedQueue<CLASDecoder> pool;
1212

1313
int sharedConstantsManagers = 64;
1414

1515
public CLASDecoderPool(int size, String variation, String timestamp) {
1616

17-
pool = new ArrayBlockingQueue<>(size);
17+
pool = new ConcurrentLinkedQueue<>();
1818

1919
CLASDecoder d0 = null;
2020

@@ -35,11 +35,11 @@ public CLASDecoderPool(int size, String variation, String timestamp) {
3535
}
3636

3737
public CLASDecoder take() throws InterruptedException {
38-
return pool.take();
38+
return pool.poll();
3939
}
4040

4141
public void put(CLASDecoder decoder) throws InterruptedException {
42-
pool.put(decoder);
42+
pool.offer(decoder);
4343
}
4444

4545
}

0 commit comments

Comments
 (0)