Scheduler Strong APA
Release
|
Strong APA Scheduler. More...
Files | |
file | schedulerstrongapa.c |
Strong APA Scheduler Implementation. | |
file | schedulerstrongapa.h |
Strong APA Scheduler API. | |
Classes | |
struct | Scheduler_strong_APA_Node |
Scheduler node specialization for Strong APA schedulers. More... | |
struct | Scheduler_strong_APA_CPU |
CPU related variables and a CPU_Control to implement BFS. More... | |
struct | Scheduler_strong_APA_Context |
Scheduler context and node definition for Strong APA scheduler. More... | |
Macros | |
#define | SCHEDULER_STRONG_APA_MAXIMUM_PRIORITY 255 |
#define | SCHEDULER_STRONG_APA_ENTRY_POINTS |
Entry points for the Strong APA Scheduler. More... | |
Functions | |
void | _Scheduler_strong_APA_Initialize (const Scheduler_Control *scheduler) |
Initializes the scheduler. More... | |
void | _Scheduler_strong_APA_Node_initialize (const Scheduler_Control *scheduler, Scheduler_Node *node, Thread_Control *the_thread, Priority_Control priority) |
Initializes the node with the given priority. More... | |
void | _Scheduler_strong_APA_Block (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node) |
Blocks the thread. More... | |
void | _Scheduler_strong_APA_Unblock (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node) |
Unblocks the thread. More... | |
void | _Scheduler_strong_APA_Update_priority (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node) |
Updates the priority of the node. More... | |
bool | _Scheduler_strong_APA_Ask_for_help (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node) |
Asks for help. More... | |
void | _Scheduler_strong_APA_Reconsider_help_request (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node) |
Reconsiders help request. More... | |
void | _Scheduler_strong_APA_Withdraw_node (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, Thread_Scheduler_state next_state) |
Withdraws the node. More... | |
void | _Scheduler_strong_APA_Add_processor (const Scheduler_Control *scheduler, Thread_Control *idle) |
Adds the idle thread to a processor. More... | |
Thread_Control * | _Scheduler_strong_APA_Remove_processor (const Scheduler_Control *scheduler, struct Per_CPU_Control *cpu) |
Removes an idle thread from the given cpu. More... | |
void | _Scheduler_strong_APA_Yield (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node) |
Performs a yield operation. More... | |
void | _Scheduler_strong_APA_Start_idle (const Scheduler_Control *scheduler, Thread_Control *idle, struct Per_CPU_Control *cpu) |
Starts an idle thread. More... | |
bool | _Scheduler_strong_APA_Set_affinity (const Scheduler_Control *scheduler, Thread_Control *thread, Scheduler_Node *node_base, const Processor_mask *affinity) |
Sets the affinity . More... | |
Strong APA Scheduler.
This is an implementation of the Strong APA scheduler defined by Cerqueira et al. in Linux's Processor Affinity API, Refined: Shifting Real-Time Tasks Towards Higher Schedulability.
The scheduled and ready nodes are accessed via the Scheduler_strong_APA_Context::Ready which helps in backtracking when a node which is executing on a CPU gets blocked. New node is allocated to the cpu by checking all the executing nodes in the affinity set of the node and the subsequent nodes executing on the processors in its affinity set.
#define SCHEDULER_STRONG_APA_ENTRY_POINTS |
Entry points for the Strong APA Scheduler.
Definition at line 151 of file schedulerstrongapa.h.
#define SCHEDULER_STRONG_APA_MAXIMUM_PRIORITY 255 |
Definition at line 146 of file schedulerstrongapa.h.
void _Scheduler_strong_APA_Add_processor | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | idle | ||
) |
Adds the idle thread to a processor.
scheduler | The scheduler control instance. | |
[in,out] | The | idle thread to add to the processor. |
Definition at line 886 of file schedulerstrongapa.c.
bool _Scheduler_strong_APA_Ask_for_help | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Asks for help.
scheduler | The scheduler control instance. |
the_thread | The thread that asks for help. |
node | The node of the_thread. |
true | The request for help was successful. |
false | The request for help was not successful. |
Definition at line 822 of file schedulerstrongapa.c.
void _Scheduler_strong_APA_Block | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Blocks the thread.
scheduler | The scheduler control instance. | |
[in,out] | the_thread | The thread to block. |
[in,out] | node | The node of the thread to block. |
Definition at line 759 of file schedulerstrongapa.c.
void _Scheduler_strong_APA_Initialize | ( | const Scheduler_Control * | scheduler | ) |
Initializes the scheduler.
scheduler | The scheduler to initialize. |
Definition at line 732 of file schedulerstrongapa.c.
void _Scheduler_strong_APA_Node_initialize | ( | const Scheduler_Control * | scheduler, |
Scheduler_Node * | node, | ||
Thread_Control * | the_thread, | ||
Priority_Control | priority | ||
) |
Initializes the node with the given priority.
scheduler | The scheduler control instance. | |
[out] | node | The node to initialize. |
the_thread | The thread of the node to initialize. | |
priority | The priority for node. |
Definition at line 935 of file schedulerstrongapa.c.
void _Scheduler_strong_APA_Reconsider_help_request | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Reconsiders help request.
scheduler | The scheduler control instance. | |
the_thread | The thread to reconsider the help request of. | |
[in,out] | node | The node of the_thread |
Definition at line 837 of file schedulerstrongapa.c.
Thread_Control* _Scheduler_strong_APA_Remove_processor | ( | const Scheduler_Control * | scheduler, |
struct Per_CPU_Control * | cpu | ||
) |
Removes an idle thread from the given cpu.
scheduler | The scheduler instance. |
cpu | The cpu control to remove from scheduler. |
Definition at line 920 of file schedulerstrongapa.c.
bool _Scheduler_strong_APA_Set_affinity | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | thread, | ||
Scheduler_Node * | node_base, | ||
const Processor_mask * | affinity | ||
) |
Sets the affinity .
scheduler | The scheduler control instance. | |
the_thread | The thread to yield. | |
[in,out] | node | The node of the_thread. |
Definition at line 956 of file schedulerstrongapa.c.
void _Scheduler_strong_APA_Start_idle | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | idle, | ||
struct Per_CPU_Control * | cpu | ||
) |
Starts an idle thread.
scheduler | The scheduler instance. | |
[in,out] | the_thread | An idle thread. |
cpu | The cpu for the operation. |
Definition at line 902 of file schedulerstrongapa.c.
void _Scheduler_strong_APA_Unblock | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Unblocks the thread.
scheduler | The scheduler control instance. | |
[in,out] | the_thread | The thread to unblock. |
[in,out] | node | The node of the thread to unblock. |
Definition at line 785 of file schedulerstrongapa.c.
void _Scheduler_strong_APA_Update_priority | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Updates the priority of the node.
scheduler | The scheduler control instance. | |
the_thread | The thread for the operation. | |
[in,out] | node | The node to update the priority of. |
Definition at line 802 of file schedulerstrongapa.c.
void _Scheduler_strong_APA_Withdraw_node | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node, | ||
Thread_Scheduler_state | next_state | ||
) |
Withdraws the node.
scheduler | The scheduler control instance. | |
[in,out] | the_thread | The thread to change the state to next_state. |
[in,out] | node | The node to withdraw. |
next_state | The next state for the_thread. |
Definition at line 853 of file schedulerstrongapa.c.
void _Scheduler_strong_APA_Yield | ( | const Scheduler_Control * | scheduler, |
Thread_Control * | the_thread, | ||
Scheduler_Node * | node | ||
) |
Performs a yield operation.
scheduler | The scheduler control instance. | |
the_thread | The thread to yield. | |
[in,out] | node | The node of the_thread. |
Definition at line 741 of file schedulerstrongapa.c.