Expand description
A lockless append-only unrolled linked list, with a single writer and multiple independent readers.
The list is represented by a Writer
-Reader
pair, created by new
.
The data is stored in contiguous chunks of increasing size, allocated as
needed by Writer::push()
and stored in a linked list. Pushing a new
value in the list is a O(1)
operation.
The Reader
can be cloned and can iterate over the data, yielding pinned
references to each element in order. The iteration gracefully stops at the
end of the list and can be resumed. Advancing the iteration is a O(1)
operation.
Both the Writer
and the Reader
s hold a reference count over the list,
which is deallocated when the Writer
and all the Reader
s are dropped.
Structs§
- Iter
- Iterator over the list. The iteration returns None when there’s currently no more item in the list, but can be resumed at a later time.
- Reader
- Read half of a
concurrent_list
; it can be cloned and it can be iterated over, to go through the elements of the list. - Writer
- Write half of a
concurrent_list
; can onlypush()
a value to the end of the list, allocating new chunks if necessary.