News for hackers. Stuff that matters.
Re:No nuances, just buggy code (was: related to Spinlock imp... by pizlonator on Sunday January 05, 2020 @02:49PM (#21963542)
sched_yield means “yield to any thread if it’s easy to do so or do nothing”. That meaning fits the requirements of some algorithms, particularly if you call it a finite number of times before doing something more drastic like a blocking syscall (like futex wait, lock acquisition, whatever) that will block until the condition you’re waiting for is fulfilled.

Think of it as a speculative optimization on top of busy waiting, not as a way to control the scheduler.

There are no comments on this comment yet.