Figurę 4.8: Priority dispaich queues
SRUN
SRUN
SRUN
SRUN
SRUN
SRUN
SRUN
ii::’::1
dqactmap
• • •• |
• • • • |
1 |
• •• • |
• • • • |
0 |
1 |
0 |
1 |
• • • • |
• t • • |
• •• • |
n |
•••• |
•••• |
3 |
2 |
1 |
0 |
struct dispq dispq[ ];
dq_first
struct procs
SRUN
SRUN
6runprocs « 9 Active process list
struct ..
with p_pri - maxrunpd - n
• PREEMPT() — a macro that simply tests to see if kprunrun is set. If it is, then preempt() is called.
pswtch() — selccts the next highest priority process to run (Figurę 4.9). The selected process must also be loaded into memory (i.e., marked SLOAD). If the parent process has set SNOWAIT and the process is a zombie, the process is