|
@@ -8,8 +8,8 @@ using namespace std;
|
|
|
|
|
|
|
|
SchedRR::SchedRR(vector<int> argn) {
|
|
SchedRR::SchedRR(vector<int> argn) {
|
|
|
// Round robin recibe la cantidad de cores y sus cpu_quantum por parámetro
|
|
// Round robin recibe la cantidad de cores y sus cpu_quantum por parámetro
|
|
|
- nucleos = argn[0];
|
|
|
|
|
- quantum = argn[1];
|
|
|
|
|
|
|
+ nucleos = argn[1];
|
|
|
|
|
+ quantum = argn[2];
|
|
|
cur_pid = IDLE_TASK;
|
|
cur_pid = IDLE_TASK;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -66,6 +66,8 @@ int SchedRR::tick(int cpu, const enum Motivo m) {
|
|
|
cur_pid=IDLE_TASK;
|
|
cur_pid=IDLE_TASK;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (cur_pid==IDLE_TASK)
|
|
|
|
|
+ switch_process=1;
|
|
|
if (p_map[cur_pid].quantum_count>quantum) {
|
|
if (p_map[cur_pid].quantum_count>quantum) {
|
|
|
switch_process=1;
|
|
switch_process=1;
|
|
|
p_map[cur_pid].state=READY;
|
|
p_map[cur_pid].state=READY;
|