2. Spin lock. A spin lock is the simplest synchronization mechanism pos- sible on most shared memory machines. This spin
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
2. Spin lock. A spin lock is the simplest synchronization mechanism pos- sible on most shared memory machines. This spin
2. Spin lock. A spin lock is the simplest synchronization mechanism pos- sible on most shared memory machines. This spin lock relies on the exchange primitive to atomically load the old value and store a new value. The lock rou- tine performs the exchange operation repeatedly until it finds the lock unlocked. The more optimized spin lock employs cache coherence and uses a load to check the lock allowing it to spin with a shared variable in the cache. Explain the differences between these two spin locks and what are the benefits of one over the other.