-
-
-
CENAPAD-MGCO
A seguir: Chaves e Camas
Acima: Multiplexação do Processador
Anterior: Criação de processos e
void schedule() {
disableInterrupts();
while(nrofActiveProcesses > 0) {
currentProcess = ready.get();
/* escolhe o proximo processo */
iotransfer(kernelCoroutine,
currentProcess.coroutine, clockInterruptVector);
if(currentProcess.state == READY)
ready.put(currentProcess);
}
transfer(kernelCoroutine, fatherCoroutine);
}
void processEnd() {
disableInterrupts();
nrofActiveProcesses--;
currentProcess.state = FINISHED;
transfer(currentProcess.coroutine, kernel);
}