OS161 Process Scheduling

OS161 provides a simple round-robin scheduler by default. It works like this:

  • hardclock from $OS161_SRC/kern/thread/clock.c will be periodically called (from hardware clock interrupt handler)

  • Two functions may be called there after:

    • schedule to change the order the threads in ready queue, which currently does nothing
    • thread_consider_migraton to enable thread migration among CPU cores
  • Then it will call thread_yield to cause the current thread yield to another thread

We need to play with the schedule function to give interactive threads higher priority.

more ...