RTEMS CPU Kit with SuperCore  4.11.3
Modules | Files | Data Structures | Typedefs | Enumerations | Functions | Variables

The scheduler nodes can be in four states. More...

Collaboration diagram for SMP Scheduler:

Modules

 Deterministic Priority SMP Scheduler
 This is an implementation of the global fixed priority scheduler (G-FP).
 
 Simple Priority SMP Scheduler
 The Simple Priority SMP Scheduler allocates a processor for the processor count highest priority ready threads.
 

Files

file  schedulersmp.h
 SMP Scheduler API.
 
file  schedulersmpimpl.h
 SMP Scheduler Implementation.
 

Data Structures

struct  Scheduler_SMP_Context
 Scheduler context specialization for SMP schedulers. More...
 
struct  Scheduler_SMP_Node
 Scheduler node specialization for SMP schedulers. More...
 

Typedefs

typedef Scheduler_Node *(* Scheduler_SMP_Get_highest_ready) (Scheduler_Context *context, Scheduler_Node *node)
 
typedef Scheduler_Node *(* Scheduler_SMP_Get_lowest_scheduled) (Scheduler_Context *context, Scheduler_Node *filter, Chain_Node_order order)
 
typedef void(* Scheduler_SMP_Extract) (Scheduler_Context *context, Scheduler_Node *node_to_extract)
 
typedef void(* Scheduler_SMP_Insert) (Scheduler_Context *context, Scheduler_Node *node_to_insert)
 
typedef void(* Scheduler_SMP_Move) (Scheduler_Context *context, Scheduler_Node *node_to_move)
 
typedef void(* Scheduler_SMP_Update) (Scheduler_Context *context, Scheduler_Node *node_to_update, Priority_Control new_priority)
 
typedef Thread_Control *(* Scheduler_SMP_Enqueue) (Scheduler_Context *context, Scheduler_Node *node_to_enqueue, Thread_Control *needs_help)
 
typedef Thread_Control *(* Scheduler_SMP_Enqueue_scheduled) (Scheduler_Context *context, Scheduler_Node *node_to_enqueue)
 
typedef void(* Scheduler_SMP_Allocate_processor) (Scheduler_Context *context, Thread_Control *scheduled, Thread_Control *victim)
 

Enumerations

enum  Scheduler_SMP_Node_state { SCHEDULER_SMP_NODE_BLOCKED, SCHEDULER_SMP_NODE_SCHEDULED, SCHEDULER_SMP_NODE_READY }
 SMP scheduler node states. More...
 

Functions

void _Scheduler_SMP_Start_idle (const Scheduler_Control *scheduler, Thread_Control *thread, struct Per_CPU_Control *cpu)
 

Variables

const bool _Scheduler_SMP_Node_valid_state_changes [3][3]
 

Detailed Description

The scheduler nodes can be in four states.

State transitions are triggered via basic operations

dot_inline_dotgraph_8.png

During system initialization each processor of the scheduler instance starts with an idle thread assigned to it. Lets have a look at an example with two idle threads I and J with priority 5. We also have blocked threads A, B and C with priorities 1, 2 and 3 respectively. The scheduler nodes are ordered with respect to the thread priority from left to right in the below diagrams. The highest priority node (lowest priority number) is the leftmost node. Since the processor assignment is independent of the thread priority the processor indices may move from one state to the other.

dot_inline_dotgraph_9.png

Lets start A. For this an enqueue operation is performed.

dot_inline_dotgraph_10.png

Lets start C.

dot_inline_dotgraph_11.png

Lets start B.

dot_inline_dotgraph_12.png

Lets change the priority of thread A to 4.

dot_inline_dotgraph_13.png

Now perform a blocking operation with thread B. Please note that thread A migrated now from processor 0 to processor 1 and thread C still executes on processor 1.

dot_inline_dotgraph_14.png

Enumeration Type Documentation

◆ Scheduler_SMP_Node_state

SMP scheduler node states.

Enumerator
SCHEDULER_SMP_NODE_BLOCKED 

This scheduler node is blocked.

A scheduler node is blocked if the corresponding thread is not ready.

SCHEDULER_SMP_NODE_SCHEDULED 

The scheduler node is scheduled.

A scheduler node is scheduled if the corresponding thread is ready and the scheduler allocated a processor for it. A scheduled node is assigned to exactly one processor. The count of scheduled nodes in this scheduler instance equals the processor count owned by the scheduler instance.

SCHEDULER_SMP_NODE_READY 

This scheduler node is ready.

A scheduler node is ready if the corresponding thread is ready and the scheduler did not allocate a processor for it.