FreeNOS
|
Responsible for deciding which Process may execute on the local Core. More...
#include <Scheduler.h>
Public Types | |
enum | Result { Success, InvalidArgument } |
Result code. More... | |
Public Member Functions | |
Scheduler () | |
Constructor function. More... | |
Size | count () const |
Get number of processes on the schedule. More... | |
Result | enqueue (Process *proc, bool ignoreState) |
Add a Process to the run schedule. More... | |
Result | dequeue (Process *proc, bool ignoreState) |
Remove a Process from the run schedule. More... | |
Process * | select () |
Select the next process to run. More... | |
Private Attributes | |
Queue< Process *, MAX_PROCS > | m_queue |
Contains processes ready to run. More... | |
Responsible for deciding which Process may execute on the local Core.
Definition at line 36 of file Scheduler.h.
enum Scheduler::Result |
Scheduler::Scheduler | ( | ) |
Size Scheduler::count | ( | ) | const |
Get number of processes on the schedule.
Definition at line 27 of file Scheduler.cpp.
References Queue< T, N >::count(), and m_queue.
Referenced by dequeue().
Scheduler::Result Scheduler::dequeue | ( | Process * | proc, |
bool | ignoreState | ||
) |
Remove a Process from the run schedule.
Definition at line 44 of file Scheduler.cpp.
References count(), Queue< T, N >::count(), ERROR, FATAL, Process::getID(), Process::getState(), InvalidArgument, m_queue, Queue< T, N >::pop(), Queue< T, N >::push(), Process::Ready, and Success.
Referenced by ProcessManager::dequeueProcess().
Scheduler::Result Scheduler::enqueue | ( | Process * | proc, |
bool | ignoreState | ||
) |
Add a Process to the run schedule.
Definition at line 32 of file Scheduler.cpp.
References ERROR, Process::getID(), Process::getState(), InvalidArgument, m_queue, Queue< T, N >::push(), Process::Ready, and Success.
Referenced by ProcessManager::enqueueProcess().
Process * Scheduler::select | ( | ) |
Select the next process to run.
Definition at line 69 of file Scheduler.cpp.
References Queue< T, N >::count(), m_queue, NULL, Queue< T, N >::pop(), and Queue< T, N >::push().
Referenced by ProcessManager::schedule().