Closed Star-xing1 closed 2 years ago
Make the BUG part of code clearer Bug part starts at line 244 in mlfq.py
# reset number of ticks left for all jobs (just for lower jobs?)
# add to highest run queue (if not doing I/O)
for j in range(numJobs):
# print('-> Boost %d (timeLeft %d)' % (j, job[j]['timeLeft']))
if job[j]['timeLeft'] > 0:
# print('-> FinalBoost %d (timeLeft %d)' % (j, job[j]['timeLeft']))
job[j]['currPri'] = hiQueue
#job[j]['ticksLeft'] = allotment[hiQueue]
job[j]['ticksLeft'] = quantum[hiQueue]
#revise here
# print('BOOST END: QUEUES look like:', queue)
There is a PR that fixes this. https://github.com/remzi-arpacidusseau/ostep-homework/pull/18
There is a PR that fixes this. #18
THANKS!
In the Chapter8's homework,mlfq.py seems to be have a little bug. When reaching the time of BOOST(the parameters set by -B),the job in the list should be all be improved to the queue which has the highest priority and the ticksLeft should be reset to the quantum which has the highest priority ,but in the origin mlfq.py it is reset to the allotment(the parameters set by -a) of the queue.This causes the job to be executed by the CPU for only one time slice after returning to the highest priority queue(because the allotment is initialized to 1). Bug part starts at line 244 in mlfq.py ` # change priority to high priority
reset number of ticks left for all jobs (just for lower jobs?)