Loading...
Searching...
No Matches
Round Robin Scheduler

This module module provides round robin scheduling for all runable threads within each not masked priority. More...

Detailed Description

This module module provides round robin scheduling for all runable threads within each not masked priority.

Priority 0 is masked by default. This implementation tries to find a balance between low resources (static memory: a timer and an uint8), fairness in terms of CPU time share and simplicity. But it does round robin the runqueue when the timer ticks even if the thread just got the CPU.

This module might be used if threads are not divisible into priorities and cooperation can not be ensured.

Files

file  sched_round_robin.h
 Round Robin Scheduler.
 

Macros

#define SCHED_RR_TIMEOUT   10000
 Time between round robin calls in Units of SCHED_RR_TIMERBASE.
 
#define SCHED_RR_TIMERBASE   ZTIMER_USEC
 ztimer to use for the round robin scheduler
 
#define SCHED_RR_MASK   (1 << 0)
 Masks off priorities that should not be scheduled default: 0 is masked.
 

Functions

void sched_round_robin_init (void)
 Initialises the Round Robin Scheduler.
 

Macro Definition Documentation

◆ SCHED_RR_MASK

#define SCHED_RR_MASK   (1 << 0)

Masks off priorities that should not be scheduled default: 0 is masked.

Priority 0 (highest) should always be masked. Threads with that priority may not be programmed with the possibility of being scheduled in mind. Parts of this scheduler assume 0 current_rr_priority is uninitialised.

Definition at line 74 of file sched_round_robin.h.

◆ SCHED_RR_TIMEOUT

#define SCHED_RR_TIMEOUT   10000

Time between round robin calls in Units of SCHED_RR_TIMERBASE.

Defaults to 10ms

Definition at line 48 of file sched_round_robin.h.

◆ SCHED_RR_TIMERBASE

#define SCHED_RR_TIMERBASE   ZTIMER_USEC

ztimer to use for the round robin scheduler

Defaults to ZTIMER_MSEC if available else it uses ZTIMER_USEC

Definition at line 61 of file sched_round_robin.h.