Similarly to the join method, the initial version of EPOS-- you are currently working with implements thread synchronization with a simple trick:
1. |
class Synchronizer_Common
|
That is, synchronization abstractions such as Semaphore and Mutex continuously test for changes on a control variable, invoking yield after each test (line 2). This trick allows for empty implementations of wakeup and wakeup_all, but bears little predictability and performance.
You are requested to modify the implementation of thread synchronization so that waiting threads no longer waste time sampling control variables and that scheduling is not affected by its implementation.