Skip to content
  • Ben Pfaff's avatar
    Fix two bugs in the base Pintos code: · d4c30c6a
    Ben Pfaff authored
    1. Idle thread doesn't get initialized well: it hangs around on the
       ready list until we have idle time.  Fix by using a semaphore to
       make sure the idle thread gets initialized.
    
    2. After idle thread does get initialized, it can get put back on the
       ready list if you yield from the timer interrupt.  Fix by not ever
       putting the idle thread on the ready list.
    
    Plus fix a bug in the sample solution that tends to mask #2:
    
    3. Doesn't yield from timer interrupt when unblocking a thread.  Fix
       by yielding from timer interrupt when unblocking a thread (of
       higher priority).
    
    Also, fix something that confused students:
    
    4. Rename enable_mlfqs to thread_mlfqs and move it to thread.c (to
       reduce confusion about where it is declared), and heavily comment
       to ensure that students know when it gets initialized.
    
    These problems were drawn to my attention by Godmar Back.  Thanks!
    d4c30c6a