2 releases
0.0.2 | Nov 6, 2021 |
---|---|
0.0.1 | Oct 21, 2021 |
0.0.0 |
|
#15 in #append-only
36 downloads per month
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
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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 Reader
s hold a reference count over the list,
which is deallocated when the Writer
and all the Reader
s are dropped.