Crates.io | utils-atomics |
lib.rs | utils-atomics |
version | 1.1.2 |
source | src |
created_at | 2022-08-03 21:34:02.751096 |
updated_at | 2023-12-20 12:54:28.23824 |
description | Various atomic utils |
homepage | |
repository | https://github.com/Aandreba/atomic-utils |
max_upload_size | |
id | 638361 |
size | 177,397 |
Simple crate with various miscelaneous atomic-related utils
An atomic queue intended for use cases where taking the full contents of the queue is needed.
The queue is, basically, an atomic singly-linked list, where nodes are first allocated and then the list's tail is atomically updated.
When the queue is "chopped", the list's tail is swaped to null, and it's previous tail is used as the base of the [ChopIter
]
The performance of pushing elements is expected to be similar to pushing elements to a SegQueue
or Mutex<Vec<_>>
,
but "chopping" elements is expected to be arround 2 times faster than with a Mutex<Vec<_>>
, and 3 times faster than a SegQueue
You can see the benchmark results here
FillQueue
when:FillQueue
when:SegQueue
)Name | Description | Enables | Default |
---|---|---|---|
std |
Enables libstd functionality | alloc |
Yes |
alloc |
Enables liballoc functionality | Yes (via std ) |
|
alloc_api |
Enables allocator_api functionality |
alloc & nightly |
No |
futures |
Enables async/await functionality | No | |
const |
Enables constant trait implementations | No | |
nightly |
Enables the use of nightly features | Yes |