[ Class Overview ] [ PIT ]
Task 5: Time-slice scheduling for OOStuBS
Learning objectives
- Protection of critical sections in the operating system with the help of the
Guard
- Implementation of preemptive scheduling through timer interrupts
Task description
The synchronisation of activities within OOStuBS has been changed to the use of the pro/epilogue model in task 3. Now a coarse-grained locking strategy should be applied and a system call interface should be defined. The scheduler should be able to displace threads triggered by the timer interrupt.
To achieve this, the classes Guarded_Scheduler
,
Thread
, PIT
and Watch
must be implemented.
To be able to call the protected methods of the scheduler from user programs, the global variable
scheduler
must no longer be an object of the class Scheduler
,
but must be an instance of the class Guarded_Scheduler
.
Since the main() method, as a part of the operating system kernel, is also a protected section, it shall run on the epilogue level. In particular, it must not release the epilogue lock itself.
Implementation notes
Consistency tests in Locker can be used to ensure that the epilogue level is entered and left correctly.
Consider which cases have to be distinguished when switching threads, which methods are called in the process, and where the epilogue level has to be entered or left.
Templates
For this task we do not provide anything (except for the file and class structure).Additional information
- Information on the Programmable Interrupt Timer (PIT)