Module scheduler

Source

Structsยง

Scheduler ๐Ÿ”’
SchedulerProcess ๐Ÿ”’
A wrapper around Process that has extra details the scheduler cares about

Enumsยง

ProcessState

Constantsยง

MIN_PRIORITY_VALUE ๐Ÿ”’

Staticsยง

SCHEDULER ๐Ÿ”’
SHUTDOWN ๐Ÿ”’

Functionsยง

exit_current_process
Exit the current process, and move the all_state to the scheduler. The caller of this function (i.e. interrupt) will use the all_state to go back to the scheduler. This function will remove the context from the CPU, and thus the value in all_state will be dropped.
is_process_running
push_process
schedule
scheduler_interrupt_handler ๐Ÿ”’
sleep_current_process
stop_scheduler
What this function does is that it tells the scheduler to stop scheduling any more processes. And start the shutdown process.
swap_context
syscall_interrupt_handler ๐Ÿ”’
take_current_process ๐Ÿ”’ โš 
Safety
wait_for_pid
with_current_process
with_current_process_and_state ๐Ÿ”’
with_process
yield_current_if_any