From 78f64e98e25afe9b56658fbf2ae699c4e3d6626d Mon Sep 17 00:00:00 2001 From: Benjamin Prud'homme Date: Fri, 4 Oct 2024 17:54:44 -0400 Subject: [PATCH] Fiber refactorings --- .../handrolled/throughput/spsc/BusyConcurrentQueuePerfTest.java | 2 +- .../jctools/handrolled/throughput/spsc/BusyQueuePerfTest.java | 2 +- .../handrolled/throughput/spsc/ConcurrentQueuePerfTest.java | 2 +- .../org/jctools/handrolled/throughput/spsc/QueuePerfTest.java | 2 +- .../src/main/java/org/jctools/jmh/latency/MpqBurstCost.java | 2 +- .../src/main/java/org/jctools/jmh/latency/QueueBurstCost.java | 2 +- .../java/org/jctools/jmh/latency/spsc/MpqRelaxedBurstCost.java | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/BusyConcurrentQueuePerfTest.java b/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/BusyConcurrentQueuePerfTest.java index 626e8002b..ded11c339 100644 --- a/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/BusyConcurrentQueuePerfTest.java +++ b/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/BusyConcurrentQueuePerfTest.java @@ -44,7 +44,7 @@ public static void main(final String[] args) throws Exception { private static long performanceRun(final int runNumber, final ConcurrentQueue queue) throws Exception { final Producer p = new Producer(queue); - final Thread thread = new Thread(p); + final Thread thread = Thread.ofVirtual(p); thread.start(); final ConcurrentQueueConsumer consumer = queue.consumer(); Integer result; diff --git a/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/BusyQueuePerfTest.java b/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/BusyQueuePerfTest.java index f0c0e9c67..69f8c906a 100644 --- a/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/BusyQueuePerfTest.java +++ b/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/BusyQueuePerfTest.java @@ -44,7 +44,7 @@ public static void main(final String[] args) throws Exception { private static long performanceRun(int runNumber, Queue queue) throws Exception { Producer p = new Producer(queue); - Thread thread = new Thread(p); + Thread thread = Thread.ofVirtual(p); thread.start();// producer will timestamp start Integer result; diff --git a/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/ConcurrentQueuePerfTest.java b/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/ConcurrentQueuePerfTest.java index d80634ad6..1b9a9bf0c 100755 --- a/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/ConcurrentQueuePerfTest.java +++ b/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/ConcurrentQueuePerfTest.java @@ -44,7 +44,7 @@ public static void main(final String[] args) throws Exception { private static long performanceRun(int runNumber, ConcurrentQueue queue) throws Exception { Producer p = new Producer(queue); - Thread thread = new Thread(p); + Thread thread = Thread.ofVirtual(p); thread.start(); // producer will timestamp start ConcurrentQueueConsumer consumer = queue.consumer(); diff --git a/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/QueuePerfTest.java b/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/QueuePerfTest.java index 5bedb6473..b645f03c8 100755 --- a/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/QueuePerfTest.java +++ b/jctools-benchmarks/src/main/java/org/jctools/handrolled/throughput/spsc/QueuePerfTest.java @@ -46,7 +46,7 @@ public static void main(final String[] args) throws Exception { private static long performanceRun(int runNumber, Queue queue) throws Exception { Producer p = new Producer(queue); - Thread thread = new Thread(p); + Thread thread = Thread.ofVirtual(p); thread.start();// producer will timestamp start Integer result; diff --git a/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/MpqBurstCost.java b/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/MpqBurstCost.java index 27f0a37d1..7dd7daccb 100644 --- a/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/MpqBurstCost.java +++ b/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/MpqBurstCost.java @@ -83,7 +83,7 @@ public void setupQueueAndConsumers() { consumers[i] = new Consumer(q, i); } - consumerExecutor = Executors.newFixedThreadPool(consumerCount); + consumerExecutor = Executors.newVirtualThreadPerTaskExecutor(); } @Setup(Level.Iteration) diff --git a/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/QueueBurstCost.java b/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/QueueBurstCost.java index c7140db44..ffdc75669 100644 --- a/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/QueueBurstCost.java +++ b/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/QueueBurstCost.java @@ -83,7 +83,7 @@ public void setupQueueAndConsumers() { consumers[i] = new Consumer(q, i); } - consumerExecutor = Executors.newFixedThreadPool(consumerCount); + consumerExecutor = Executors.newVirtualThreadPerTaskExecutor(); } @Setup(Level.Iteration) diff --git a/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/spsc/MpqRelaxedBurstCost.java b/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/spsc/MpqRelaxedBurstCost.java index 88efd04bd..d694da36e 100644 --- a/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/spsc/MpqRelaxedBurstCost.java +++ b/jctools-benchmarks/src/main/java/org/jctools/jmh/latency/spsc/MpqRelaxedBurstCost.java @@ -108,7 +108,7 @@ public void setupQueueAndConsumer() { } q = MessagePassingQueueByTypeFactory.createQueue(qType, 128 * 1024); consumer = new Consumer(q); - consumerThread = new Thread(consumer); + consumerThread = Thread.ofVirtual(consumer); consumerThread.start(); }