DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Threads

Spin locks

A spin lock is also used for mutually exclusive access to some resource. The _spin_lock(S) function differs from mutex_lock(S) in implementation. If a spin lock is not available, the calling thread is not blocked, instead the caller busy waits (or ``spin''s) until the lock becomes available.

   _spin_lock(  spin_t *lock);
   _spin_unlock(spin_t *lock);
Considerations for the use of spin locks:


NOTE: Extreme care should be exercised in using spin locks. The minimally safe environment for using spin locks may be bound threads running on a system with more than one processor. However, deadlocks are always possible.


Next topic: Recursive mutual exclusion
Previous topic: Mutual exclusion locks

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005