[ Class Overview ] [ Assembler Crash Course ]
Task 4: Context switching for OOStuBS
Learning objectives
- Refreshing your assembler knowledge (see also assembler crash course Assembler Crash Course)
- Understand the steps of a process switch
- Differentiation between active and passive objects
Task description
The goal of this task is to implement simple process management, where the user processes control the processor release following the coroutine concept.
This will require the implementation of some functions to access the
struct toc, the classes
Coroutine,
Dispatcher,
Entrant and
Scheduler, as well as the function
kickoff. In addition, OOStuBS is now
to get an Application.
The struct toc as well as the classes
Chain and
Queue, which are needed for the solution
of the task, are provided as templates by us.
In order to be able to access process switching everywhere in OOStuBS, a global instance of the dispatcher should be created in part b and replaced by a global instance scheduler of the Scheduler in part c.
The functionality of the classes mentioned should be demonstrated with
the help of a meaningful test program. For this purpose, a global instance
scheduler of the Scheduler
class should be created in the main of Task 1
and a first user process application (an object of the
Application class) should be created,
which in turn creates further user processes. Also test the methods
Scheduler::exit()
and Scheduler::kill(Entrant& item)
.