How to do an atomic compare and swap on a SharedArray

Hi all :slight_smile:

I want to use shared memory and do an atomic_cas! (Atomically compare-and-set) in some file/ shared array. How would I do that?

Thanks!