portable-atomic
portable-atomic copied to clipboard
Provides generic `Atomic<T>` type
Requirements:
- Should completely avoid problems with padding. (crossbeam's AtomicCell and atomic-rs have problems with padding).
- Should be able to support structs and enums with multiple fields. (atomig doesn't support multiple fields)
- Should be
forbid(unsafe_code)compatible on the user side. (I have mentioned in the past the approach of using unsafe marker trait.) Atomic<&T>must be sound (i.e.,Relaxedordering is not allowed), butRelaxedordering should be allowed on plain data types like integers.
prototype: https://github.com/taiki-e/portable-atomic/compare/main...generic