3 ms·
Could you implement it using AtomicUsize (using only relaxed operations) in Rust? With AtomicUsize representing the words. You aren't allowed to put pointers in
by Vecr 3y ago
Could you implement it using AtomicUsize (using only relaxed operations) in Rust? With AtomicUsize representing the words. You aren't allowed to put pointers in those.
- gpderetta 3y agoIf atomicusize is sequentially consistent, then yes.
- exDM69 3y agoNo, it can not use relaxed memory ordering. Looking at disassembly of relaxed atomic operations, they are just normal loads and stores with no memory barriers or special instructions. That is not enough to make this algorithm guard a critical section.