OOStuBS - Technische Informatik II (TI-II)  2.4
Öffentliche Methoden | Aufstellung aller Elemente
Organizer Klassenreferenz

Extension of Scheduler to support blocking of Threads. Mehr ...

#include <organizer.h>

Klassendiagramm für Organizer:
Inheritance graph
[Legende]
Zusammengehörigkeiten von Organizer:
Collaboration graph
[Legende]

Öffentliche Methoden

Customeractive () const
 Return the currently active customer.
void block (Waitingroom &waitingroom)
 Block the active customer.
bool kill (Customer &that)
 Kill a customer either waiting, running or ready.
void wakeup (Customer &customer)
 Wake up a customer waiting in a room.
- Öffentliche Methoden geerbt von Scheduler
void exit ()
 Remove the currently active thread from the queue.
void insert (Thread &that)
 Insert the specified thread into the queue.
 Scheduler ()
 Default Constructor clearing started flag.
void start ()
 Start the scheduling by starting the first thread.
void yield ()
 Yield to another ready thread.
 ~Scheduler ()
 Default Denstructor clearing started flag.

Weitere Geerbte Elemente

- Geschützte Methoden geerbt von Scheduler
bool kill (Thread &that)
 Remove the specified thread from the queue of threads, killing the execution of this thread.
void next ()
 helper function stop the execution of the current thread and switch to next one
void reactivate (Thread &unblocked)

Ausführliche Beschreibung

Extension of Scheduler to support blocking of Threads.

The organizer extends the basic round-robin scheduling through a blocking semantics. Extended threads called customers are able to wait for certain operations to finish or may wait if a ressource is unavailable. To support this ressources which might be unavailable inherit from Waitingroom to track and manage individual customers waiting fro their service. The organizer handles the transitions of customer between the states "ready", "running" and "blocked".

Definiert in Zeile 35 der Datei organizer.h.

Dokumentation der Elementfunktionen

Customer * Organizer::active ( ) const

Return the currently active customer.

Rückgabe
The currently active customer

Erneute Implementation von Scheduler.

Definiert in Zeile 26 der Datei organizer.cc.

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

void Organizer::block ( Waitingroom waitingroom)

Block the active customer.

This method puts the currently active customer in the waiting queue of waitingroom. Afterwards the execution switches to the next ready thread.

Parameter
waitingroomThe room the customer will wait in

Definiert in Zeile 7 der Datei organizer.cc.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

bool Organizer::kill ( Customer that)

Kill a customer either waiting, running or ready.

This method extends the functionality of Scheduler::kill through the removal of currently waiting customers. Therefore the supplied customer is checked if it is waiting in a room. If this is the case the customer is removed from the waiting queue of this room. Otherwise Scheduler::kill is called.

Parameter
thatThe customer to kill

Definiert in Zeile 20 der Datei organizer.cc.

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

void Organizer::wakeup ( Customer customer)

Wake up a customer waiting in a room.

This method removes the customer from the waitingroom it is waiting in and puts it in the ready queue.

Parameter
customerThe customer to wake up

Definiert in Zeile 14 der Datei organizer.cc.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien: