![]() |
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Round-Robin task-switching strategy: each runnable task receives one time slice (one tick interval) in turn before the kernel moves to the next task. More...
#include <stk_strategy_rrobin.h>
Round-Robin task-switching strategy: each runnable task receives one time slice (one tick interval) in turn before the kernel moves to the next task.
Internally maintains two intrusive lists:
m_tasks — tasks currently eligible for scheduling (runnable).m_sleep — tasks that called Sleep() or are otherwise blocked.The iterator cursor (m_prev) points to the most recently scheduled task. On each call to GetNext() the cursor advances by one position in m_tasks, wrapping around at the end (closed-loop list). When m_tasks is empty, GetNext() returns nullptr and the kernel transitions to the sleep trap.
| NoSleepYield | If true, Yield() keeps the task in the runnable set and the strategy rotates the cursor (see OnTaskYield). If false, the kernel performs the legacy yield: the task sleeps for YIELD_TICKS. |