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(3synch) function differs from mutex_lock(3synch) 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

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004