Aufgabe 7: Anwendung
GateQueue Class Reference
#include <interrupt/gatequeue.h>
Public Member Functions | |
| bool | enqueue (Gate *item) |
| Enqueues the provided item at the end of the queue. More... | |
| Gate * | dequeue () |
| Removes the first element in the queue and returns it. More... | |
Detailed Description
Queue for Gates.
While for OOStuBS a simple linked list is sufficient (by having a head pointer in this calls and extending Gate with a next pointer), for multi-core systems like MPStuBS it needs to be able to enqueue the same Gate item on each Core (up to Core::MAX) at the same time (a multi-queue, requiring a head pointer array member in this class and a next pointer array in Gate).
Member Function Documentation
| bool GateQueue::enqueue | ( | Gate * | item | ) |
Enqueues the provided item at the end of the queue.
In MPStuBS the item is added to the internal queue belonging to the core it is currently executed on.
- Parameters
-
item Queue element to be appended.
- Returns
trueif successfully added to the queue,falseif it is already in the queue
| Gate * GateQueue::dequeue | ( | ) |
Removes the first element in the queue and returns it.
In MPStuBS the item is retrieved from the internal queue belonging to the core it is currently executed on.
- Returns
- Pointer to the removed item or
nullptrif the queue was empty.
The documentation for this class was generated from the following files:
- interrupt/gatequeue.h
- interrupt/gatequeue.cc