OS161 Process Scheduling
OS161 provides a simple round-robin scheduler by default. It works like this:
-
hardclockfrom$OS161_SRC/kern/thread/clock.cwill be periodically called (from hardware clock interrupt handler) -
Two functions may be called there after:
scheduleto change the order the threads in ready queue, which currently does nothingthread_consider_migratonto enable thread migration among CPU cores
-
Then it will call
thread_yieldto cause the current thread yield to another thread
We need to play with the schedule function to give interactive threads higher
priority.