You are on page 1of 2

Take Home Lab (Project 2)

TA: Qiang Xu, xuq22@mcmaster.ca


February 22, 2016

Project 2 (Take Home Lab): Priority Scheduler with Donation


Deadline: 11:30pm, March 7th, 2016, Grading: 10%
Tasks
1. Complete the scheduler with priority donation and revocation
2. Test using nachos.ag.ThreadGrader6
SUBMIT THE ANSWERS TO THE QUESTIONS VIA SVN AS
your-svn-home-directory/week8/takehome/nachos

Tips
1. The only package you will edit is nachos.threads.
2. Do not change any existing things in autoGrader methods.
3. The debugging flags that you may find useful for this lab are t for threads.
4. You can directly use the configuration file in nachos.proj1.You need to make sure the PriorityScheduler
is set when youre ready to run Nachos with priority scheduling.
5. To implement priority donation, one needs to handle both multiple donations, i.e., multiple threads
waiting on the same resource; and nested donations, where H is waiting on a lock that M holds and M
is waiting on a lock that L holds, then H should donate its priority to both M and L.
6. It is important that you do not break the abstraction barriers while doing this part the Lock class does
not need to be modified. Priority donation should be accomplished by completing the PriorityQueue
subclass of ThreadQueue that is in PriorityScheduler.java.
7. For the tasks, I recommend you implement PriorityScheduler without donation first, then add
donation into it.
8. Adding priority donation will involve changing getEffectivePriority.

9. When a threads priority changes due to a setPriority call, either up or down, it may
affect the priority of threads that it has donated its priority to.
10. In Eclipse, to test your implementation using nachos.ag.ThreadGrader6, you need to edit the
run configurations to add arguments -[NO SPACE]-[SPACE]nachos.ag.ThreadGrader6

You might also like