LockFreeMPSCQueue

Lock-free Multiply-Producer Single-Consumer Queue. Note: This queue is NOT linearizable. It provides only quiescent consistency for its operations.

In particular, the following execution is permitted for this queue, but is not permitted for a linearizable queue:

Thread 1: addLast(1) = true, removeFirstOrNull() = null
Thread 2: addLast(2) = 2 // this operation is concurrent with both operations in the first thread

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun addLast(element: E): Boolean
Link copied to clipboard
fun close()
Link copied to clipboard