The current implementation using sched_yield() does not reliably give other threads a chance to run. The problem is demonstrated by the poor performance of the following test case:
This test creates a second thread which needs to acquire a pthread mutex owned by the main thread. The main thread continually releases/reacquires the mutex around a call to Thread::YieldCPU (see RuntimePreempt), but the second thread still experiences long wait times.
The current implementation using sched_yield() does not reliably give other threads a chance to run. The problem is demonstrated by the poor performance of the following test case:
This test creates a second thread which needs to acquire a pthread mutex owned by the main thread. The main thread continually releases/reacquires the mutex around a call to Thread::YieldCPU (see RuntimePreempt), but the second thread still experiences long wait times.