A seguir: Escalonamento e fim dos Acima: Multiplexação do Processador Anterior: Estruturas de Dados
class Process {
Coroutine coroutine;
byte[] workArea;
int state;
public Process(procedure initialProcedure,
int workAreaSize) {
coroutine = createCoroutine(initialProcedure,
new byte[workAreaSize]);
/* cria a co-rotina correspondente ao processo */
kernel.addProcess(this);
state = READY;
}
}
no kernel:
public void addProcess(Process p){
ready.put(p);
nrofActiveProcess++;
}
public void coStart() {
transfer(fatherCoroutine, kernelCoroutine);
}