| ▲ | smj-edison 6 hours ago | ||||||||||||||||
Don't most people use C++11 atomics now? You have SeqCst, Release, Acquire, and Relaxed (with Consume deprecated due to the difficulty of implementing it). You can do loads, stores, and exchanges with each ordering type. Zig, Rust, and C all use the same orderings. I guess Java has its own memory model since it's been around a lot longer, but most people have standardized around C++'s design. Which is a slight shame since Load-Linked/Store-Conditional is pretty cool, but I guess that's limited to ARM anyways, and now they've added extensions for CAS due to speed. | |||||||||||||||||
| ▲ | superxpro12 6 hours ago | parent | next [-] | ||||||||||||||||
I've taken an interest in lock-free queues for ultra-low power embedded... think Cortex-m0, or even avr/pic. Things get interesting when you're working with a cpu that lacks the ldrex/strem assembly instructions that makes this all work. I think youre only options at that point are disable/enable interrupts. IF anyone has any insights into this constraint I'd love to hear it. | |||||||||||||||||
| |||||||||||||||||
| ▲ | loeg 6 hours ago | parent | prev [-] | ||||||||||||||||
LL/SC is still hinted at in the C++11 model with std::atomic<T>::compare_exchange_weak: https://en.cppreference.com/w/cpp/atomic/atomic/compare_exch... | |||||||||||||||||