Home >  Term: spin lock
spin lock

Threads use a spin lock to test a lock variable over and over until some other task releases the lock. That is, the waiting thread spins on the lock until the lock is cleared. Then, the waiting thread sets the lock while inside the critical region. After work in the critical region is complete, the thread clears the spin lock so another thread can enter the critical region. The difference between a spin lock and a mutex is that an attempt to get a mutex held by someone else will block and release the LWP; a spin lock does not release the LWP. See also mutex lock.

0 0

Creator

  • Shemayah
  •  (Bronze) 432 points
  • 100% positive feedback
© 2024 CSOFT International, Ltd.