lockmap/lib.rs
1//! A thread-safe hashmap implementation providing per-key level locking and atomic operations.
2//!
3//! # Overview
4//! `lockmap` provides a concurrent hashmap implementation that allows fine-grained locking at the key level.
5//! It uses internal sharding for better performance under high concurrency.
6//!
7//! # Features
8//! - Thread-safe access with per-key locking
9//! - Entry API for exclusive access to values
10//! - Efficient concurrent operations through sharding
11//! - Safe atomic updates
12//!
13//! # Examples
14//! ```
15//! use lockmap::LockMap;
16//!
17//! let map = LockMap::<String, u32>::new();
18//!
19//! // Basic operations
20//! map.insert("key1".into(), 42);
21//! assert_eq!(map.get("key1"), Some(42));
22//!
23//! // Entry API for exclusive access
24//! {
25//! let mut entry = map.entry("key2".into());
26//! entry.get_mut().replace(123);
27//! }
28//!
29//! // Remove a value
30//! assert_eq!(map.remove("key1"), Some(42));
31//! assert_eq!(map.get("key1"), None);
32//! ```
33mod futex;
34#[doc = include_str!("../README.md")]
35mod lockmap;
36mod shards_map;
37
38use futex::*;
39pub use lockmap::*;
40use shards_map::*;