[ Class Overview ] [ Assembler Crash Course ]
Task 4: Context switching for OOStuBS
Learning objectives
- Refreshing your assembler knowledge (see also our 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
struct toc, classes
Coroutine,
Dispatcher,
Entrant and
Scheduler, as well as the
kickoff function.
In addition, OOStuBS will now get an
Application.
We provide struct toc as well as the
Chain and
Queue classes in the template code.
In order to be able to access process switching everywhere in OOStuBS, you should create a global instance of the dispatcher in part b and replace it by a global instance scheduler of the Scheduler in part c.
You should demonstrate each class's functionality with a meaningful test
program.
For this purpose, extend main.cc
to create a global instance
scheduler of the
Scheduler class and a first user process
application
(an Application object),
which in turn creates further user processes.
Also make sure to test the methods
Scheduler::exit()
and Scheduler::kill(Entrant& item)
.
(What happens if your application kills itself?)