High-performance non-blocking SPSC ring buffer specialized for Double.
Layout: a single Array[Long] storing raw doubleToRawLongBits. The FastFlow signal uses two reserved NaN bit patterns: EMPTY_BITS (0xFFF8_0000_0000_0001L) is the empty marker, DONE_BITS (0xFFF8_0000_0000_0002L) is the in-band end-of-stream marker. If the user offers a Double whose raw bits happen to equal either reserved pattern, it is canonicalized to Double.NaN's standard bit pattern (0x7FF8_0000_0000_0000L) on insertion.
This canonicalization is unobservable: IEEE 754 guarantees NaN != NaN, all NaNs compare equal under reference NaN semantics, and there is no portable Scala/Java way to round-trip a specific NaN payload through arithmetic. The remapping only affects two specific raw bit patterns, which the user could not have meaningfully produced through normal floating-point operations.
In-band "done" sentinel: producers can call offerDone() to insert the end-of-stream marker after the last data value. Consumers reading via pollPacked() receive EMPTY_BITS for empty, DONE_BITS for the sentinel, or the raw doubleToRawLongBits value for data. This removes the need for a separate control queue alongside the data queue.
One memory-ordered op per insert/remove, one cache line per slot.
SPSC: one producer thread, one consumer thread.
Value parameters
- capacity
-
must be a positive power of two
Attributes
- Companion
- object
- Source
- DoubleSpscRingBuffer.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Attributes
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Source
- DoubleSpscRingBuffer.scala
Insert the in-band done sentinel. Returns false if the buffer is full; the caller is expected to retry until it succeeds.
Insert the in-band done sentinel. Returns false if the buffer is full; the caller is expected to retry until it succeeds.
Attributes
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Source
- DoubleSpscRingBuffer.scala
Atomically polls the next slot and returns the raw bits:
Atomically polls the next slot and returns the raw bits:
EMPTY_BITS— slot is empty; consumer index is NOT advanced.DONE_BITS— in-band done sentinel; consumer index advanced.- any other value —
doubleToRawLongBits(value)for the payload; consumer index advanced. Decode withDouble.longBitsToDouble.
Attributes
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Source
- DoubleSpscRingBuffer.scala
Concrete fields
Attributes
- Source
- DoubleSpscRingBuffer.scala
Inherited fields
Attributes
- Inherited from:
- DoubleSpscConsumerFields (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad0 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad1 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscPad2 (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscProducerFields (hidden)
- Source
- DoubleSpscRingBuffer.scala
Attributes
- Inherited from:
- DoubleSpscProducerFields (hidden)
- Source
- DoubleSpscRingBuffer.scala