Search in sources :

Example 1 with MpscBlockingConsumerArrayQueue

use of org.jctools.queues.MpscBlockingConsumerArrayQueue in project ignite-3 by apache.

the class SingleThreadExecutorBenchmark method defaultSingleThreadPollExecutorWithMpscBlockingQueue.

@Benchmark
public void defaultSingleThreadPollExecutorWithMpscBlockingQueue() throws InterruptedException {
    ThreadPoolExecutor pool = // 
    ThreadPoolUtil.newBuilder().coreThreads(// 
    1).maximumThreads(// 
    1).poolName(// 
    "default").enableMetric(// 
    false).workQueue(// TODO asch IGNITE-15997
    new MpscBlockingConsumerArrayQueue<>(TIMES)).keepAliveSeconds(// 
    60L).threadFactory(// 
    new NamedThreadFactory("default", true)).build();
    execute(new DefaultSingleThreadExecutor(pool));
}
Also used : MpscBlockingConsumerArrayQueue(org.jctools.queues.MpscBlockingConsumerArrayQueue) NamedThreadFactory(org.apache.ignite.internal.thread.NamedThreadFactory) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1 NamedThreadFactory (org.apache.ignite.internal.thread.NamedThreadFactory)1 MpscBlockingConsumerArrayQueue (org.jctools.queues.MpscBlockingConsumerArrayQueue)1 Benchmark (org.openjdk.jmh.annotations.Benchmark)1