HW2 - mm1729/xv6 GitHub Wiki

Stage 1 - creating threading stuff

  • exit sets the state and join clears the thread

Stage 2 - creating mutex

  • 32 mutexes have state bit, chain and valid bit
  • have a spinlock for the array of 32 mutexes

mutex_lock(mutex_id) { array[mutex_id] is valid while(mutex is locked) sleep; state = 1 ... }