Module sched

Module sched 

Source
Expand description

This module provides access to the scheduler.

Modulesยง

dispch ๐Ÿ”’
rr
rt
task
This module provides the basic task and thread structures for the scheduler.
thread

Macrosยง

dequeue ๐Ÿ”’
We define dequeue as a macro in order to avoid borrow checker issues.

Structsยง

Scheduler

Staticsยง

DISABLED ๐Ÿ”’
NEXT_TICK ๐Ÿ”’
SCHED ๐Ÿ”’

Functionsยง

disable
This will disable rescheduling until the next call to enable. Use with caution!
enable
init
Initializes the scheduler. This should be called once during kernel initialization, before any threads are created.
needs_reschedule
This should be called on each timer tick, and if it returns true, sched_enter should be called to reschedule.
reschedule
Triggers a reschedule immediately, when interrupts are enabled. This must be called after enqueueing a thread, or after waking up a thread, or putting the current thread to sleep.
sched_enter
This will be called by the architecture-specific code to enter the scheduler. It will land the current thread, pick the next thread to run, and return its context and task.
with
This function provides safe access to the global scheduler. It disables interrupts and locks the scheduler. Use with caution!

Type Aliasesยง

GlobalScheduler ๐Ÿ”’
TaskMap ๐Ÿ”’
ThreadMap ๐Ÿ”’
WaiterView ๐Ÿ”’