|
|
@@ -1,4 +1,5 @@
|
|
|
#include <map>
|
|
|
+#include <iostream>
|
|
|
#include <vector>
|
|
|
#include <queue>
|
|
|
#include "sched_mfq.h"
|
|
|
@@ -68,9 +69,15 @@ uint SchedMFQ::next_pid(){
|
|
|
int SchedMFQ::tick(int core, const enum Motivo m) {
|
|
|
uint switch_process = 0;
|
|
|
uint cur_pid = current_pid(core);
|
|
|
+ if (cur_pid == IDLE_TASK)
|
|
|
+ return next_pid();
|
|
|
|
|
|
uint p_q = pid_queue(cur_pid);
|
|
|
+ //cout << "curpid " << cur_pid << endl; //-1
|
|
|
+ //cout << "p_q " << p_q << endl; //65535, segfault
|
|
|
+
|
|
|
process cur_process=v_cola[p_q][cur_pid];
|
|
|
+ //cout << "asd4" << endl;
|
|
|
switch (m) {
|
|
|
case TICK:
|
|
|
cur_process.quantum_count++;
|