2 releases
Uses new Rust 2024
new 0.1.1 | Apr 2, 2025 |
---|---|
0.1.0 | Apr 2, 2025 |
#176 in #lock-free
94 downloads per month
Used in 177 crates
(2 directly)
38KB
252 lines
Aloe Atomic
Aloe Atomic is a Rust crate that offers a streamlined and robust wrapper around the standard std::atomic
module. It facilitates operations on atomic data with an emphasis on convenience and performance.
Key Features
- Type Parametrization: The
Atomic
struct is generic, designed to support various types. - Thread-Safety: Implements atomic operations ensuring thread safety without manual synchronization.
- Enhanced Arithmetic: Provides
AddAssign
andSubAssign
implementations for atomic arithmetic. - Atomic Operations: Includes atomic functions for setting, exchanging, comparing, and incrementing/decrementing values.
- Memory Barriers: Implements memory read/write barriers to ensure memory order consistency using
std::atomic_thread_fence
. - Lock-Free Safety: Safeguards user operations with assurances related to lock-free atomic types, aligning with C++ atomic capabilities.
Usage
To use Aloe Atomic in your project, include it in your Cargo.toml
dependencies:
[dependencies]
aloe-atomic = "0.1.0"
Example
use aloe_atomic::Atomic;
fn main() {
let mut atomic_value = Atomic::new_from_initial_value(10);
atomic_value.add_assign(5);
assert_eq!(atomic_value.get(), 15);
}
Contributing
Contributions are welcome! Please fork the repository and submit a pull request.
License
This project is licensed under the GPL-3.0 license.
This README.md file was generated by an AI model and may not be 100% accurate, however it should be pretty good.
This crate is a translation of the JUCE module.
JUCE is a c++ software framework for developing high performance audio applications.
Usage falls under the GPLv3 as well as the JUCE commercial license.
See github.com/juce-framework/JUCE and the JUCE license page for details.
This crate is in the process of being translated from c++ to rust. For progress updates, please see the workspacer rust project. designed specifically for rust projects.
Dependencies
~13–27MB
~376K SLoC