#linked-list #reader #append-only #reference #unrolled #single-writer #multi-reader

concurrent-list

An append-only, single-writer multi-reader unrolled linked list

2 releases

0.0.2 Nov 6, 2021
0.0.1 Oct 21, 2021
0.0.0 Oct 21, 2021

#10 in #append-only

MIT/Apache

17KB
237 lines

concurrent-list

An append-only, single-writer multi-reader unrolled linked list.

The MSRV (Minimum Supported Rust Version) is 1.56, for UnsafeCell::raw_get.

concurrent-list is no_std-compatible (requiring alloc).

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

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 Readers hold a reference count over the list, which is deallocated when the Writer and all the Readers are dropped.

No runtime deps