Mark3 Realtime Kernel
Mark3::CoScheduler Class Reference

The CoScheduler class. This class implements the coroutine scheduler. Similar to the Mark3 thread scheduler, the highest-priority active object is scheduled / returned for execution. If no active co-routines are available to be scheduled, then the scheduler returns nullptr. More...

#include <cosched.h>

Static Public Member Functions

static void Init ()
 Init Initialize the coroutine scheduler prior to use. Must be called prior to using any other functions in the coroutine scheduler. More...
 
static CoPrioMapGetPrioMap ()
 GetPrioMap Get the pointer to the priority map object used by the scheduler. More...
 
static CoListGetStopList ()
 GetStopList Get the pointer to the coroutine list managing initialized coroutines that are not awaiting execution. More...
 
static CoListGetCoList (PORT_PRIO_TYPE uPriority_)
 GetCoList Retrieve the coroutine list associated with a given priority. More...
 
static CoroutineSchedule ()
 Schedule Determine what coroutine (if any) is the next to be executed. More...
 

Static Private Attributes

static CoList m_aclPriorities [PORT_COROUTINE_PRIORITIES]
 
static CoList m_clStopList
 
static CoPrioMap m_clPrioMap
 

Detailed Description

The CoScheduler class. This class implements the coroutine scheduler. Similar to the Mark3 thread scheduler, the highest-priority active object is scheduled / returned for execution. If no active co-routines are available to be scheduled, then the scheduler returns nullptr.

Definition at line 33 of file cosched.h.

Member Function Documentation

◆ GetCoList()

CoList * Mark3::CoScheduler::GetCoList ( PORT_PRIO_TYPE  uPriority_)
static

GetCoList Retrieve the coroutine list associated with a given priority.

Parameters
uPriority_Priority to get the coroutine list of.
Returns
coroutine list pointer or nullptr on invalid priority.

Definition at line 51 of file cosched.cpp.

◆ GetPrioMap()

CoPrioMap * Mark3::CoScheduler::GetPrioMap ( )
static

GetPrioMap Get the pointer to the priority map object used by the scheduler.

Returns
Return the priority map object owned by the schedule

Definition at line 39 of file cosched.cpp.

◆ GetStopList()

CoList * Mark3::CoScheduler::GetStopList ( )
static

GetStopList Get the pointer to the coroutine list managing initialized coroutines that are not awaiting execution.

Returns
Pointer to the coroutine stop list

Definition at line 45 of file cosched.cpp.

◆ Init()

void Mark3::CoScheduler::Init ( void  )
static

Init Initialize the coroutine scheduler prior to use. Must be called prior to using any other functions in the coroutine scheduler.

Examples:
lab2_coroutines/main.cpp.

Definition at line 29 of file cosched.cpp.

◆ Schedule()

Coroutine * Mark3::CoScheduler::Schedule ( )
static

Schedule Determine what coroutine (if any) is the next to be executed.

Returns
next coroutine to execute, or nullptr if no coroutines are ready to be scheduled.
Examples:
lab2_coroutines/main.cpp.

Definition at line 60 of file cosched.cpp.

Member Data Documentation

◆ m_aclPriorities

CoList Mark3::CoScheduler::m_aclPriorities
staticprivate

Definition at line 80 of file cosched.h.

◆ m_clPrioMap

CoPrioMap Mark3::CoScheduler::m_clPrioMap
staticprivate

Definition at line 82 of file cosched.h.

◆ m_clStopList

CoList Mark3::CoScheduler::m_clStopList
staticprivate

Definition at line 81 of file cosched.h.


The documentation for this class was generated from the following files: