NEED_RESCHED(9)

NAME
need_resched - context switch notification

SYNOPSIS
#include <sys/cpu.h>
void
need_resched(struct cpu_info *ci);

DESCRIPTION
The need_resched() function is the machine-independent interface for the scheduler to notify machine-dependent code that a context switch from the current process is required. This event may occur if a higher priority process appears on the run queue or if the current process has exceeded its time slice.

Specifically, the need_resched() function will perform the following operations:

•   Set a global flag which is checked by userret(9) when returning to user-mode execution.

•   Post an asynchronous software trap (AST).

SEE ALSO
scheduler(9), userret(9)