#mutex #atomic #vector #memory

aloe-au-types

Aloe AU Types provides concurrency primitives, vector unit detection, atomic operations, and enhanced memory management for performance-critical applications involving multi-threading and hardware capability detection. This crate is a translation of the c++ juce module serving the same function.

1 unstable release

Uses new Rust 2024

new 0.1.1 Apr 2, 2025

#157 in #mutex

27 downloads per month
Used in 7 crates (4 directly)

GPL-3.0 license

145KB
1.5K SLoC

Aloe AU Types

Aloe AU Types provides foundational data structures and operations critical for managing thread safety, vector unit detection, and atomic operations in high-performance computing environments. This crate features a sophisticated abstraction over mutexes, spinlocks, atomic stacks, and a comprehensive suite of vector unit checks tailored for capabilities like SSE, AVX, and Neon.

Features

  • Thread-safe Lists and Iterators: Facilitates robust handling of concurrent operations with deferred add/remove/clear capabilities, ensuring efficient manipulation of collections in multi-threaded contexts.

  • Vector Unit Typing and Detection: Enumerates vector unit types and provides utility functions to detect CPU-specific capabilities like SSE3 or AVX, crucial for applications needing detailed hardware profiling and capability detection.

  • Atomic Operations: Implements atomic operations using platform-specific atomic functions with barriers, ensuring memory safety and synchronization across threads without resorting to locks.

  • Reference Management: Includes reference-counted objects and automatic memory managers like CAAutoFree and CAAutoArrayDelete, simplifying dynamic memory management and garbage collection.

  • Exception Handling: Provides extended exception types for capturing detailed error states, vital for robust error handling and debugging in complex systems.

Example Usage

use aloe_au_types::CAMutex;

fn main() {
    let mut mutex = CAMutex::new(b"ExampleMutex".as_ptr());
    // Lock the mutex
    if mutex.lock() {
        // Perform thread-safe operations
        mutex.unlock();
    }
}

Installation

Include the following in your Cargo.toml:

[dependencies]
aloe-au-types = "0.1.0"

License

This project is licensed under the terms of the GNU General Public License v3.0.


Note: 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

~14–25MB
~410K SLoC