Browse Source

soy un retardado

David 10 years ago
parent
commit
d552df08ff
1 changed files with 4 additions and 2 deletions
  1. 4 2
      sched_rr.cpp

+ 4 - 2
sched_rr.cpp

@@ -8,8 +8,8 @@ using namespace std;
 
 SchedRR::SchedRR(vector<int> argn) {
 	// 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;
 }
 
@@ -66,6 +66,8 @@ int SchedRR::tick(int cpu, const enum Motivo m) {
 			cur_pid=IDLE_TASK;
 			break;
 	}
+	if (cur_pid==IDLE_TASK)
+		switch_process=1;
 	if (p_map[cur_pid].quantum_count>quantum) {
 		switch_process=1;
 		p_map[cur_pid].state=READY;