Open yellowhatter opened 4 months ago
@Mallets @YuanYuYuan FYI
Emulation of Atomics is more a C++ thing than a Rust one. If a platform does not support 64-bit atomics, then it won't be available in Rust. See https://doc.rust-lang.org/std/sync/atomic/#portability.
Emulation of Atomics is more a C++ thing than a Rust one. If a platform does not support 64-bit atomics, then it won't be available in Rust. See https://doc.rust-lang.org/std/sync/atomic/#portability.
Then this is even worse - we won't compile if there is no atomic u64 while we could have conditionally replaced it with u32....
And the doc says that on some platforms there is a performance penalty for CAS etc - this is also a thing to pay attention to while optimizing critical watchdog processing mechanism after 1.0.0
Describe the feature
SHM subsystem uses atomics for both buffer headers (u32) and buffer watchdog(u64).
On some platforms 64-bit atomics are not supported (and I guess that library emulates them with Mutex introducing a huge performance drop in contended scenario), and some platforms support even u128 atomics.
I think for the future plan we need to investigate on this issue and our target platforms and maybe use a platform-dependent atomic sizes in SHM. The codebase more or less intends this future improvement.
I place this issue just to highlight this future milestone.