diff options
Diffstat (limited to 'man3')
| -rw-r--r-- | man3/pthread_spin_init.3 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/man3/pthread_spin_init.3 b/man3/pthread_spin_init.3 index af9a926718..9d43fd035e 100644 --- a/man3/pthread_spin_init.3 +++ b/man3/pthread_spin_init.3 @@ -114,6 +114,19 @@ POSIX.1-2001. .PP Support for process-shared spin locks is a POSIX option. The option is supported in the glibc implementation. +.SH NOTES +Spin locks should be employed in conjunction with +real-time scheduling policies +.RB ( SCHED_FIFO , +or possibly +.BR SCHED_RR ). +Use of spin locks with nondeterministic scheduling policies such as +.BR SCHED_OTHER +probably indicates a design mistake. +The problem is that if a thread operating under such a policy +is scheduled off the CPU while it holds a spin lock, +then other threads will waste time spinning on the lock +until the lock holder is once more rescheduled and releases the lock. .SH SEE ALSO .ad l .nh |
