How is spin lock implemented under the hood?
- by httpinterpret
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.