No, but reasonable heuristics.
> How do you spin lock briefly? You mean break it on a timer?
> And do you mean to literally call sched_yield several times in a
> row?
Say spin 5 times, then loop with sched_yield() 5 times, then go to
sleep (block in kernel).
The theory is that you first spin waiting for someone else to soon
release a lock (if they're in a small critical region). Then loop with
sched_yield() to give someone else a chance (in case the locking
process is waiting for your timeslice to finish). After that, it's
probably going to take a long time (>100us) for the lock to be
released, so hop onto a wait queue.
Regards,
Richard....
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/