
320 CHAPTER 6 Processes and Operating Systems
/* processes[] is an array of process activation records,
stored in order of priority, with processes[0] being
the highest-priority process */
Activation_record processes[NPROCESSES];
void RMA(int current) { /* current ⫽ currently executing
process */
int i;
/* turn off current process (may be turned back on) */
processes[current].state ⫽ READY_STATE;
/* find process to start executing */
for (i ⫽ 0; i < NPROCESSES; i⫹⫹)
if (processes[i].state ⫽⫽ READY_STATE) {
/* make this the running process */
processes[i].state ⫽⫽ EXECUTING_STATE;
break;
}
}
FIGURE 6.12
C code for rate-monotonic scheduling.
6.3.2 ...