6 releases (breaking)
Uses old Rust 2015
0.5.0 | Jan 18, 2021 |
---|---|
0.4.0 | Aug 22, 2020 |
0.3.0 | Jan 18, 2018 |
0.2.0 | Nov 11, 2017 |
0.1.1 | Jan 28, 2017 |
#166 in Science
2,515 downloads per month
Used in 7 crates
(4 directly)
14KB
227 lines
lib.rs
:
A crate for things that are
- Lazily initialized
- Expensive to create
- Immutable after creation
- Used on multiple threads
Lazy<T>
is better than Mutex<Option<T>>
because after creation accessing
T
does not require any locking, just a single boolean load with
Ordering::Acquire
(which on x86 is just a compiler barrier, not an actual
memory barrier).