Skip to content

Commit

Permalink
Merge pull request #1615 from smallrye/feat/jctools-4.0.4
Browse files Browse the repository at this point in the history
feat: upgrade to JCTools 4.0.4 and use atomic+unpadded queues
  • Loading branch information
jponge authored May 30, 2024
2 parents f637325 + c6614e5 commit e4240b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -18,15 +18,15 @@ private Queues() {
}

public static <T> Queue<T> createSpscArrayQueue(int capacity) {
return new SpscUnpaddedArrayQueue<>(capacity);
return new SpscAtomicUnpaddedArrayQueue<>(capacity);
}

public static <T> Queue<T> createSpscUnboundedArrayQueue(int chunkSize) {
return new SpscUnboundedUnpaddedArrayQueue<>(chunkSize);
return new SpscUnboundedAtomicUnpaddedArrayQueue<>(chunkSize);
}

public static <T> Queue<T> createSpscChunkedArrayQueue(int capacity) {
return new SpscChunkedUnpaddedArrayQueue<>(capacity);
return new SpscChunkedAtomicUnpaddedArrayQueue<>(capacity);
}

public static <T> Supplier<Queue<T>> getXsQueueSupplier() {
Expand Down Expand Up @@ -87,7 +87,7 @@ public static <T> Supplier<Queue<T>> unbounded(int chunkSize) {
* @return the queue
*/
public static <T> Queue<T> createMpscQueue() {
return new MpscUnboundedUnpaddedArrayQueue<>(Infrastructure.getBufferSizeS());
return new MpscUnboundedAtomicUnpaddedArrayQueue<>(Infrastructure.getBufferSizeS());
}

/**
Expand All @@ -98,7 +98,7 @@ public static <T> Queue<T> createMpscQueue() {
* @return the queue
*/
public static <T> Queue<T> createSpscUnboundedQueue(int chunkSize) {
return new SpscUnboundedUnpaddedArrayQueue<>(chunkSize);
return new SpscUnboundedAtomicUnpaddedArrayQueue<>(chunkSize);
}

/**
Expand All @@ -109,6 +109,6 @@ public static <T> Queue<T> createSpscUnboundedQueue(int chunkSize) {
* @return a new queue
*/
public static <T> Queue<T> createMpscArrayQueue(int capacity) {
return new MpscUnpaddedArrayQueue<>(capacity);
return new MpscAtomicUnpaddedArrayQueue<>(capacity);
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</modules>

<properties>
<jctools-core.version>4.0.3</jctools-core.version>
<jctools-core.version>4.0.4</jctools-core.version>
<mutiny-zero.version>1.0.0</mutiny-zero.version>
<reactive-streams.version>1.0.4</reactive-streams.version>
<rxjava3.version>3.1.8</rxjava3.version>
Expand Down

0 comments on commit e4240b0

Please sign in to comment.