How to write a spinlock without using CAS

Posted by Martin on Stack Overflow See other posts from Stack Overflow or by Martin
Published on 2010-05-02T21:02:27Z Indexed on 2010/05/02 21:07 UTC
Read the original article Hit count: 248

Following on from a discussion which got going in the comments of this question.

How would one go about writing a Spinlock without CAS operations?

As the other question states:

The memory ordering model is such that writes will be atomic (if two concurrent threads write a memory location at the same time, the result will be one or the other). The platform will not support atomic compare-and-set operations.

© Stack Overflow or respective owner

Related posts about concurrency

Related posts about language-agnostic