neocortex
Shared memory crate designed for simplicity, safety, and extensibility. With minimal dependencies on libc and tracing, this crate wraps unsafe shared memory operations in a user-friendly API.
Features:
- Simple API: Offers an easy-to-use interface for shared memory operations, abstracting
libccomplexities. - Clear Error Handling: Distinguishes between
CleanandDirtysystem errors. - Built-in Synchronization: Includes a semaphore-based lock for safe shared memory access.
- Extendable: Flexibility to implement custom synchronization logic through the
CortexSynctrait.
Simple example using the built-in semaphore lock
// Creating a segment of shared memory
let key = 123;
let data: f64 = 42.0;
let cortex_1: = new.unwrap;
assert_eq!;
// Attaching to an existing segment of shared memory (using an existing key)
let cortex_2: = attach.unwrap;
assert_eq!;