CHOOSEPROC(9)

NAME
chooseproc - select next process from system run queue

SYNOPSIS
#include <sys/proc.h>
struct proc *
chooseproc(void);

DESCRIPTION
The chooseproc() function is invoked by the scheduler to select the highest priority process from the system run queue. If a process is not available on the system run queue, chooseproc() shall go into an “idle” loop by invoking cpu_idle(9). The variable curproc is set to NULL while chooseproc() is idle so that CPU time is not allocated to the outgoing process.

The chooseproc() function must be called with the scheduler lock held (see SCHED_LOCK(9)) and at the splsched(9) interrupt protection level.

SEE ALSO
cpu_idle(9), mi_switch(9), scheduler(9), splsched(9)