The dispatcher dispatches threads and, by that, puts the scheduler's decisions into action.
More...
#include <thread/dispatcher.h>
|
static Thread * | active () |
| Returns the thread currently running on the CPU core calling this method.
|
|
static void | go (Thread *first) |
| This method stores first as life pointer for this CPU core and triggers the execution of first thread.
|
|
static void | dispatch (Thread *next) |
| Updates the life pointer to next and issues a thread change from the old to the new life pointer.
|
|
|
| Dispatcher () |
| private constructor to prevent instantiation
|
|
|
static PerCore< Thread * > | life |
| Initialize life pointer with nullptr to indicate that nothing is (yet) being executed on the respective CPU.
|
|
The dispatcher dispatches threads and, by that, puts the scheduler's decisions into action.
The dispatcher manages the life pointer that refers to the currently active thread and performs the actual switching of processes. For single-core systems, a single life pointer is sufficient, as only a single thread can be active at any one time. On multi-core systems, every CPU core needs its own life pointer.
◆ Dispatcher()
Dispatcher::Dispatcher |
( |
| ) |
|
|
private |
private constructor to prevent instantiation
◆ setActive()
static void Dispatcher::setActive |
( |
Thread * |
thread | ) |
|
|
inlinestaticprivate |
set the currently active thread
- Parameters
-
◆ active()
static Thread * Dispatcher::active |
( |
| ) |
|
|
inlinestatic |
Returns the thread currently running on the CPU core calling this method.
- Todo:
- Implement Method
◆ go()
void Dispatcher::go |
( |
Thread * |
first | ) |
|
|
static |
This method stores first
as life pointer for this CPU core and triggers the execution of first
thread.
- Note
- Only to be used for the first thread running on a CPU core.
- Parameters
-
first | First thread to be executed on this CPU core. |
- Todo:
- Implement Method
◆ dispatch()
void Dispatcher::dispatch |
( |
Thread * |
next | ) |
|
|
static |
Updates the life pointer to next and issues a thread change from the old to the new life pointer.
- Parameters
-
next | Next thread to be executed. |
- Todo:
- Implement Method
◆ life
Initialize life pointer with nullptr to indicate that nothing is (yet) being executed on the respective CPU.
The documentation for this class was generated from the following files: