1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

only by setting DYNAMIC_TICKS, the tsc counter is used to realize round-robin

This commit is contained in:
Stefan Lankes 2016-09-22 18:31:03 +02:00
parent fbaf77c8fd
commit a885c99cf2

View file

@ -205,6 +205,7 @@ void check_scheduling(void)
if (prio > curr_task->prio) {
reschedule();
#ifdef DYNAMIC_TICKS
} else if (prio == curr_task->prio) {
// if a task is ready, check if the current task runs already one tick (one time slice)
// => reschedule to realize round robin
@ -216,6 +217,7 @@ void check_scheduling(void)
//kprintf("Time slice expired for task %d on core %d. New task has priority %u.\n", curr_task->id, CORE_ID, prio);
reschedule();
}
#endif
}
}
@ -879,7 +881,9 @@ size_t** scheduler(void)
// finally make it the new current task
curr_task->status = TASK_RUNNING;
#ifdef DYNAMIC_TICKS
curr_task->last_tsc = get_rdtsc();
#endif
set_per_core(current_task, curr_task);
}