优化内存,提高队列和线程池性能。更新JCTOOL库
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.kne.cloud.network.congestion;
|
||||
|
||||
import org.jctools.queues.MpscArrayQueue;
|
||||
import org.jctools.queues.MessagePassingQueue;
|
||||
import org.jctools.queues.varhandle.MpscVarHandleArrayQueue;
|
||||
import org.kne.cloud.network.ThreadTool;
|
||||
import org.kne.opencl64.Releaser;
|
||||
|
||||
@@ -82,7 +83,7 @@ class MpscMessageBatcherReleaser<T> extends Releaser<MpscMessageBatcher0<T>> {
|
||||
|
||||
class MpscMessageBatcher0<T> implements Runnable, MessageBatcher<T> {
|
||||
|
||||
private final MpscArrayQueue<T> queue;
|
||||
private final MessagePassingQueue<T> queue;
|
||||
private final int batchSize;
|
||||
private final long maxDelay;
|
||||
private volatile Consumer<List<T>> consumer;
|
||||
@@ -94,7 +95,7 @@ class MpscMessageBatcher0<T> implements Runnable, MessageBatcher<T> {
|
||||
public MpscMessageBatcher0(int batchSize, long maxDelay, int queueCapacity) {
|
||||
this.batchSize = batchSize;
|
||||
this.maxDelay = maxDelay;
|
||||
this.queue = new MpscArrayQueue<>(queueCapacity);
|
||||
this.queue = new MpscVarHandleArrayQueue<>(queueCapacity);
|
||||
|
||||
this.batchThread = ThreadTool.makeVDaemonThread("MpscMessageBatcher", this);
|
||||
this.batchThread.start();
|
||||
|
||||
Reference in New Issue
Block a user