The didactic version of OpenEPOS implements thread scheduling (or CPU scheduling) as a property of the process management mechanisms. This is actually the way most OS implement it, but in essence, scheduling policies and mechanisms could be reused for disc, network, and other system resources. EPOS original motivation to isolate the scheduler was the possibility to implement it in hardware and thus reduce jitter for hard real-time tasks (actually threads, but that's how RT people name them)1. However, this refactoring has proven a very effective way to practice advanced software development techniques and get a insight of System-level Desgin.
Before refactoring EPOS to isolate the scheduler, inspect your current implementation and answare the following questions:
Ready Queue
?After answering the question, refactor the scheduler out of class
Thread
to create a new Scheduler
class. Queues such as Ready
must now be whitin
Scheduler
. Preserve the original polices.