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
Content copied to clipboard