How is spin lock implemented under the hood?

Posted by httpinterpret on Stack Overflow See other posts from Stack Overflow or by httpinterpret
Published on 2010-05-23T13:40:22Z Indexed on 2010/05/23 13:50 UTC
Read the original article Hit count: 484

This is a lock that can be held by only one thread of execution at a time. An attempt to acquire the lock by another thread of execution makes the latter loop until the lock is released.

How does it handle the case when two threads try to acquire the lock exactly the same time?

I think this question also applies to various of other mutex implementation.

© Stack Overflow or respective owner

Related posts about language-agnostic

Related posts about concurrency