From c6614e5d83dde5d20797396c67c45cf2ff1e905e Mon Sep 17 00:00:00 2001 From: Julien Ponge Date: Thu, 30 May 2024 16:50:25 +0200 Subject: [PATCH] feat: upgrade to JCTools 4.0.4 and use atomic+unpadded queues These do not require Unsafe access and make native compilation a non-issue. --- .../mutiny/helpers/queues/Queues.java | 22 +++++++++---------- pom.xml | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/implementation/src/main/java/io/smallrye/mutiny/helpers/queues/Queues.java b/implementation/src/main/java/io/smallrye/mutiny/helpers/queues/Queues.java index 792bee2ee..4df2953e5 100644 --- a/implementation/src/main/java/io/smallrye/mutiny/helpers/queues/Queues.java +++ b/implementation/src/main/java/io/smallrye/mutiny/helpers/queues/Queues.java @@ -3,11 +3,11 @@ import java.util.Queue; import java.util.function.Supplier; -import org.jctools.queues.unpadded.MpscUnboundedUnpaddedArrayQueue; -import org.jctools.queues.unpadded.MpscUnpaddedArrayQueue; -import org.jctools.queues.unpadded.SpscChunkedUnpaddedArrayQueue; -import org.jctools.queues.unpadded.SpscUnboundedUnpaddedArrayQueue; -import org.jctools.queues.unpadded.SpscUnpaddedArrayQueue; +import org.jctools.queues.atomic.unpadded.MpscAtomicUnpaddedArrayQueue; +import org.jctools.queues.atomic.unpadded.MpscUnboundedAtomicUnpaddedArrayQueue; +import org.jctools.queues.atomic.unpadded.SpscAtomicUnpaddedArrayQueue; +import org.jctools.queues.atomic.unpadded.SpscChunkedAtomicUnpaddedArrayQueue; +import org.jctools.queues.atomic.unpadded.SpscUnboundedAtomicUnpaddedArrayQueue; import io.smallrye.mutiny.infrastructure.Infrastructure; @@ -18,15 +18,15 @@ private Queues() { } public static Queue createSpscArrayQueue(int capacity) { - return new SpscUnpaddedArrayQueue<>(capacity); + return new SpscAtomicUnpaddedArrayQueue<>(capacity); } public static Queue createSpscUnboundedArrayQueue(int chunkSize) { - return new SpscUnboundedUnpaddedArrayQueue<>(chunkSize); + return new SpscUnboundedAtomicUnpaddedArrayQueue<>(chunkSize); } public static Queue createSpscChunkedArrayQueue(int capacity) { - return new SpscChunkedUnpaddedArrayQueue<>(capacity); + return new SpscChunkedAtomicUnpaddedArrayQueue<>(capacity); } public static Supplier> getXsQueueSupplier() { @@ -87,7 +87,7 @@ public static Supplier> unbounded(int chunkSize) { * @return the queue */ public static Queue createMpscQueue() { - return new MpscUnboundedUnpaddedArrayQueue<>(Infrastructure.getBufferSizeS()); + return new MpscUnboundedAtomicUnpaddedArrayQueue<>(Infrastructure.getBufferSizeS()); } /** @@ -98,7 +98,7 @@ public static Queue createMpscQueue() { * @return the queue */ public static Queue createSpscUnboundedQueue(int chunkSize) { - return new SpscUnboundedUnpaddedArrayQueue<>(chunkSize); + return new SpscUnboundedAtomicUnpaddedArrayQueue<>(chunkSize); } /** @@ -109,6 +109,6 @@ public static Queue createSpscUnboundedQueue(int chunkSize) { * @return a new queue */ public static Queue createMpscArrayQueue(int capacity) { - return new MpscUnpaddedArrayQueue<>(capacity); + return new MpscAtomicUnpaddedArrayQueue<>(capacity); } } diff --git a/pom.xml b/pom.xml index 90b53eb36..54de1195a 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ - 4.0.3 + 4.0.4 1.0.0 1.0.4 3.1.8