Not necessarily. The current thread may have as much right to run as the waiting thread, in which case continuing to run would also be correct behaviour. Only when a running thread itself waits or it has run out of allocated time is a thread switch needed for correctness.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2002-09-15 12:18: Subject: Frequent context switches
Very interesting. However, I don't see what th_yield() has to do with anything. Unlocking a mutex that someone else is waiting for should automatically yield in a correct thread implementation.
/ Fredrik (Naranek) Hubinette (Real Build Master)