2. Spin lock. A spin lock is the simplest synchronization mechanism pos- sible on most shared memory machines. This spin
Posted: Wed Mar 30, 2022 9:18 am
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.