1

It would seem to be a no-brainer, but just wanted to check if this is guaranteed (on Linux). Is the thread precluded from scheduling until the wait condition is satisfied? Or will the thread get scheduled, figure out it's still waiting and yield() again, wasting resources?

The reason I am asking is, if I have X threads running, and some threads are blocked for whatever reason, will the blocked threads get in the way of runnable threads (assuming they are the same priority)?

Benito Ciaro
  • 1,718
  • 12
  • 25

1 Answers1

2

Yes, they wait without consuming any CPU resources. Only spinlocks do a busy wait.

dragonroot
  • 5,653
  • 3
  • 38
  • 63