Source

Branch

1/ @0xF390

@SebAaltonen

TATAS (read-only inner-loop) is a much better pattern for a multicore system with multiple caches (https://github.com/concurrencykit/ck/blob/master/include/spinlock/fas.h#L77).

2/ @SebAaltonen

@0xF390

This is TATAS too. It does standard read until read returns unlocked (|| is short circuited -> exchange doesn’t run when outer test succeeds). Your code has extra CAS outer case. Not needed. Just makes fast path (no lock) slower.

3/ @0xF390

@SebAaltonen

Edits. You’re right! I read the wrong block. Regarding the Concurrency Kit code, which CAS outer-case are you referring to? There is none, FAS = xchg.