Class Organizer
Placement in the overall structure
- Module
- thread
- Base classes
- Scheduler
- Derived classes
- Guarded_Organizer
- Time of creation
- Task 6
- Files
organizer.h organizer.cc
Description
The Organizer is a special scheduler that additionally allows processes (Customer objects) to wait for events (Waitingroom objects).
Public methods
void block (Customer& customer, Waitingroom& waitingroom)
- Blocks the running process and gives the processor to the next ready process. It also records which event (in which waiting room) it is now waiting for.
void wakeup (Customer& customer)
- This method can be used to wake up a sleeping process, i.e. to put it back on the ready list. It should also be marked that the process is now no longer waiting for an event.
void kill (Customer& that)
- This method allows one process to kill another (that). If the process that is on the ready list, the kill method of the scheduler can be used. If, on the other hand, it is waiting for an event, it must be taken down from its list (i.e. out of the waiting room).