# 第8 章 调度：多级反馈队列

## 内容回顾

### 关键概念

• 多级反馈队列（Multi-level Feedback Queue，MLFQ）：
• 有许多独立的队列（queue），每个队列有不同的优先级（priority level）。
• 任何时刻，一个工作只能存在于一个队列中。
• MLFQ总是优先执行较高优先级的工作（即在较高级队列中的工作）。
• 每个队列中的工作具有相同的优先级，对这些工作采取轮转调度。
• MLFQ规则：
• 规则1：如果A的优先级 > B 的优先级，运行A（不运行B）。
• 规则2：如果A的优先级 = B 的优先级，轮转运行A和B。
• 规则3：工作进入系统时，放在最高优先级（最上层队列）。
• 规则4：一旦工作用完了其在某一层中的时间配额（无论中间主动放弃了多少次CPU），就降低其优先级（移入低一级队列）。
• 规则5：经过一段时间S，就将系统中所有工作重新加入最高优先级队列。

## 作业

### 1

λ python ./mlfq.py -n 2 -j 2 -M 0 -m 20 -s 1
Here is the list of inputs:
OPTIONS jobs 2
OPTIONS queues 2
OPTIONS allotments for queue  1 is   1
OPTIONS quantum length for queue  1 is  10
OPTIONS allotments for queue  0 is   1
OPTIONS quantum length for queue  0 is  10
OPTIONS boost 0
OPTIONS ioTime 5
OPTIONS stayAfterIO False
OPTIONS iobump False

For each job, three defining characteristics are given:
startTime : at what time does the job enter the system
runTime   : the total CPU time needed by the job to finish
ioFreq    : every ioFreq time units, the job issues an I/O
(the I/O takes ioTime units to complete)

Job List:
Job  0: startTime   0 - runTime   3 - ioFreq   0
Job  1: startTime   0 - runTime  15 - ioFreq   0

Compute the execution trace for the given workloads.
If you would like, also compute the response and turnaround
times for each of the jobs.

Use the -c flag to get the exact results when you are finished.


job 0运行3个时间片后完成，然后切换到job 1，连续运行18个时间片后结束：

Final statistics:
Job  0: startTime   0 - response   0 - turnaround 3
Job  1: startTime   0 - response   3 - turnaround 18

Avg  2: startTime n/a - response 1.5 - turnaround 10.50

λ python ./mlfq.py -n 2 -j 2 -M 0 -m 20 -s 1 -c
Here is the list of inputs:
OPTIONS jobs 2
OPTIONS queues 2
OPTIONS allotments for queue  1 is   1
OPTIONS quantum length for queue  1 is  10
OPTIONS allotments for queue  0 is   1
OPTIONS quantum length for queue  0 is  10
OPTIONS boost 0
OPTIONS ioTime 5
OPTIONS stayAfterIO False
OPTIONS iobump False

For each job, three defining characteristics are given:
startTime : at what time does the job enter the system
runTime   : the total CPU time needed by the job to finish
ioFreq    : every ioFreq time units, the job issues an I/O
(the I/O takes ioTime units to complete)

Job List:
Job  0: startTime   0 - runTime   3 - ioFreq   0
Job  1: startTime   0 - runTime  15 - ioFreq   0

Execution Trace:

[ time 0 ] JOB BEGINS by JOB 0
[ time 0 ] JOB BEGINS by JOB 1
[ time 0 ] Run JOB 0 at PRIORITY 1 [ TICKS 9 ALLOT 1 TIME 2 (of 3) ]
[ time 1 ] Run JOB 0 at PRIORITY 1 [ TICKS 8 ALLOT 1 TIME 1 (of 3) ]
[ time 2 ] Run JOB 0 at PRIORITY 1 [ TICKS 7 ALLOT 1 TIME 0 (of 3) ]
[ time 3 ] FINISHED JOB 0
[ time 3 ] Run JOB 1 at PRIORITY 1 [ TICKS 9 ALLOT 1 TIME 14 (of 15) ]
[ time 4 ] Run JOB 1 at PRIORITY 1 [ TICKS 8 ALLOT 1 TIME 13 (of 15) ]
[ time 5 ] Run JOB 1 at PRIORITY 1 [ TICKS 7 ALLOT 1 TIME 12 (of 15) ]
[ time 6 ] Run JOB 1 at PRIORITY 1 [ TICKS 6 ALLOT 1 TIME 11 (of 15) ]
[ time 7 ] Run JOB 1 at PRIORITY 1 [ TICKS 5 ALLOT 1 TIME 10 (of 15) ]
[ time 8 ] Run JOB 1 at PRIORITY 1 [ TICKS 4 ALLOT 1 TIME 9 (of 15) ]
[ time 9 ] Run JOB 1 at PRIORITY 1 [ TICKS 3 ALLOT 1 TIME 8 (of 15) ]
[ time 10 ] Run JOB 1 at PRIORITY 1 [ TICKS 2 ALLOT 1 TIME 7 (of 15) ]
[ time 11 ] Run JOB 1 at PRIORITY 1 [ TICKS 1 ALLOT 1 TIME 6 (of 15) ]
[ time 12 ] Run JOB 1 at PRIORITY 1 [ TICKS 0 ALLOT 1 TIME 5 (of 15) ]
[ time 13 ] Run JOB 1 at PRIORITY 0 [ TICKS 9 ALLOT 1 TIME 4 (of 15) ]
[ time 14 ] Run JOB 1 at PRIORITY 0 [ TICKS 8 ALLOT 1 TIME 3 (of 15) ]
[ time 15 ] Run JOB 1 at PRIORITY 0 [ TICKS 7 ALLOT 1 TIME 2 (of 15) ]
[ time 16 ] Run JOB 1 at PRIORITY 0 [ TICKS 6 ALLOT 1 TIME 1 (of 15) ]
[ time 17 ] Run JOB 1 at PRIORITY 0 [ TICKS 5 ALLOT 1 TIME 0 (of 15) ]
[ time 18 ] FINISHED JOB 1

Final statistics:
Job  0: startTime   0 - response   0 - turnaround   3
Job  1: startTime   0 - response   3 - turnaround  18

Avg  1: startTime n/a - response 1.50 - turnaround 10.50

### 2

#### 实例1

python ./mlfq.py -n 3 --jlist 0,200,0 -q 10 -S -c

#### 实例 2

python ./mlfq.py -n 3 --jlist 0,200,0:120,20,0 -q 10 -S -c

#### 实例3

python ./mlfq.py -n 3 --jlist 0,200,0:20,20,1 -q 10 -i 9 -S -c

### 3

λ  python ./mlfq.py -n 1 --jlist 0,10,0:15,20,0 -q 10 -c
Here is the list of inputs:
OPTIONS jobs 2
OPTIONS queues 1
OPTIONS allotments for queue  0 is   1
OPTIONS quantum length for queue  0 is  10
OPTIONS boost 0
OPTIONS ioTime 5
OPTIONS stayAfterIO False
OPTIONS iobump False

For each job, three defining characteristics are given:
startTime : at what time does the job enter the system
runTime   : the total CPU time needed by the job to finish
ioFreq    : every ioFreq time units, the job issues an I/O
(the I/O takes ioTime units to complete)

Job List:
Job  0: startTime   0 - runTime  10 - ioFreq   0
Job  1: startTime  15 - runTime  20 - ioFreq   0

Execution Trace:

[ time 0 ] JOB BEGINS by JOB 0
[ time 0 ] Run JOB 0 at PRIORITY 0 [ TICKS 9 ALLOT 1 TIME 9 (of 10) ]
[ time 1 ] Run JOB 0 at PRIORITY 0 [ TICKS 8 ALLOT 1 TIME 8 (of 10) ]
[ time 2 ] Run JOB 0 at PRIORITY 0 [ TICKS 7 ALLOT 1 TIME 7 (of 10) ]
[ time 3 ] Run JOB 0 at PRIORITY 0 [ TICKS 6 ALLOT 1 TIME 6 (of 10) ]
[ time 4 ] Run JOB 0 at PRIORITY 0 [ TICKS 5 ALLOT 1 TIME 5 (of 10) ]
[ time 5 ] Run JOB 0 at PRIORITY 0 [ TICKS 4 ALLOT 1 TIME 4 (of 10) ]
[ time 6 ] Run JOB 0 at PRIORITY 0 [ TICKS 3 ALLOT 1 TIME 3 (of 10) ]
[ time 7 ] Run JOB 0 at PRIORITY 0 [ TICKS 2 ALLOT 1 TIME 2 (of 10) ]
[ time 8 ] Run JOB 0 at PRIORITY 0 [ TICKS 1 ALLOT 1 TIME 1 (of 10) ]
[ time 9 ] Run JOB 0 at PRIORITY 0 [ TICKS 0 ALLOT 1 TIME 0 (of 10) ]
[ time 10 ] FINISHED JOB 0
[ time 10 ] IDLE
[ time 11 ] IDLE
[ time 12 ] IDLE
[ time 13 ] IDLE
[ time 14 ] IDLE
[ time 15 ] JOB BEGINS by JOB 1
[ time 15 ] Run JOB 1 at PRIORITY 0 [ TICKS 9 ALLOT 1 TIME 19 (of 20) ]
[ time 16 ] Run JOB 1 at PRIORITY 0 [ TICKS 8 ALLOT 1 TIME 18 (of 20) ]
[ time 17 ] Run JOB 1 at PRIORITY 0 [ TICKS 7 ALLOT 1 TIME 17 (of 20) ]
[ time 18 ] Run JOB 1 at PRIORITY 0 [ TICKS 6 ALLOT 1 TIME 16 (of 20) ]
[ time 19 ] Run JOB 1 at PRIORITY 0 [ TICKS 5 ALLOT 1 TIME 15 (of 20) ]
[ time 20 ] Run JOB 1 at PRIORITY 0 [ TICKS 4 ALLOT 1 TIME 14 (of 20) ]
[ time 21 ] Run JOB 1 at PRIORITY 0 [ TICKS 3 ALLOT 1 TIME 13 (of 20) ]
[ time 22 ] Run JOB 1 at PRIORITY 0 [ TICKS 2 ALLOT 1 TIME 12 (of 20) ]
[ time 23 ] Run JOB 1 at PRIORITY 0 [ TICKS 1 ALLOT 1 TIME 11 (of 20) ]
[ time 24 ] Run JOB 1 at PRIORITY 0 [ TICKS 0 ALLOT 1 TIME 10 (of 20) ]
[ time 25 ] Run JOB 1 at PRIORITY 0 [ TICKS 9 ALLOT 1 TIME 9 (of 20) ]
[ time 26 ] Run JOB 1 at PRIORITY 0 [ TICKS 8 ALLOT 1 TIME 8 (of 20) ]
[ time 27 ] Run JOB 1 at PRIORITY 0 [ TICKS 7 ALLOT 1 TIME 7 (of 20) ]
[ time 28 ] Run JOB 1 at PRIORITY 0 [ TICKS 6 ALLOT 1 TIME 6 (of 20) ]
[ time 29 ] Run JOB 1 at PRIORITY 0 [ TICKS 5 ALLOT 1 TIME 5 (of 20) ]
[ time 30 ] Run JOB 1 at PRIORITY 0 [ TICKS 4 ALLOT 1 TIME 4 (of 20) ]
[ time 31 ] Run JOB 1 at PRIORITY 0 [ TICKS 3 ALLOT 1 TIME 3 (of 20) ]
[ time 32 ] Run JOB 1 at PRIORITY 0 [ TICKS 2 ALLOT 1 TIME 2 (of 20) ]
[ time 33 ] Run JOB 1 at PRIORITY 0 [ TICKS 1 ALLOT 1 TIME 1 (of 20) ]
[ time 34 ] Run JOB 1 at PRIORITY 0 [ TICKS 0 ALLOT 1 TIME 0 (of 20) ]
[ time 35 ] FINISHED JOB 1

Final statistics:
Job  0: startTime   0 - response   0 - turnaround  10
Job  1: startTime  15 - response   0 - turnaround  20

Avg  1: startTime n/a - response 0.00 - turnaround 15.00

### 4

λ python ./mlfq.py -n 2 --jlist 0,50,9:0,50,0 -q 10 -S -i 1 -c
Here is the list of inputs:
OPTIONS jobs 2
OPTIONS queues 2
OPTIONS allotments for queue  1 is   1
OPTIONS quantum length for queue  1 is  10
OPTIONS allotments for queue  0 is   1
OPTIONS quantum length for queue  0 is  10
OPTIONS boost 0
OPTIONS ioTime 1
OPTIONS stayAfterIO True
OPTIONS iobump False

For each job, three defining characteristics are given:
startTime : at what time does the job enter the system
runTime   : the total CPU time needed by the job to finish
ioFreq    : every ioFreq time units, the job issues an I/O
(the I/O takes ioTime units to complete)

Job List:
Job  0: startTime   0 - runTime  50 - ioFreq   9
Job  1: startTime   0 - runTime  50 - ioFreq   0

Execution Trace:

[ time 0 ] JOB BEGINS by JOB 0
[ time 0 ] JOB BEGINS by JOB 1
[ time 0 ] Run JOB 0 at PRIORITY 1 [ TICKS 9 ALLOT 1 TIME 49 (of 50) ]
[ time 1 ] Run JOB 0 at PRIORITY 1 [ TICKS 8 ALLOT 1 TIME 48 (of 50) ]
[ time 2 ] Run JOB 0 at PRIORITY 1 [ TICKS 7 ALLOT 1 TIME 47 (of 50) ]
[ time 3 ] Run JOB 0 at PRIORITY 1 [ TICKS 6 ALLOT 1 TIME 46 (of 50) ]
[ time 4 ] Run JOB 0 at PRIORITY 1 [ TICKS 5 ALLOT 1 TIME 45 (of 50) ]
[ time 5 ] Run JOB 0 at PRIORITY 1 [ TICKS 4 ALLOT 1 TIME 44 (of 50) ]
[ time 6 ] Run JOB 0 at PRIORITY 1 [ TICKS 3 ALLOT 1 TIME 43 (of 50) ]
[ time 7 ] Run JOB 0 at PRIORITY 1 [ TICKS 2 ALLOT 1 TIME 42 (of 50) ]
[ time 8 ] Run JOB 0 at PRIORITY 1 [ TICKS 1 ALLOT 1 TIME 41 (of 50) ]
[ time 9 ] IO_START by JOB 0
IO DONE
[ time 9 ] Run JOB 1 at PRIORITY 1 [ TICKS 9 ALLOT 1 TIME 49 (of 50) ]
[ time 10 ] IO_DONE by JOB 0
[ time 10 ] Run JOB 1 at PRIORITY 1 [ TICKS 8 ALLOT 1 TIME 48 (of 50) ]
[ time 11 ] Run JOB 1 at PRIORITY 1 [ TICKS 7 ALLOT 1 TIME 47 (of 50) ]
[ time 12 ] Run JOB 1 at PRIORITY 1 [ TICKS 6 ALLOT 1 TIME 46 (of 50) ]
[ time 13 ] Run JOB 1 at PRIORITY 1 [ TICKS 5 ALLOT 1 TIME 45 (of 50) ]
[ time 14 ] Run JOB 1 at PRIORITY 1 [ TICKS 4 ALLOT 1 TIME 44 (of 50) ]
[ time 15 ] Run JOB 1 at PRIORITY 1 [ TICKS 3 ALLOT 1 TIME 43 (of 50) ]
[ time 16 ] Run JOB 1 at PRIORITY 1 [ TICKS 2 ALLOT 1 TIME 42 (of 50) ]
[ time 17 ] Run JOB 1 at PRIORITY 1 [ TICKS 1 ALLOT 1 TIME 41 (of 50) ]
[ time 18 ] Run JOB 1 at PRIORITY 1 [ TICKS 0 ALLOT 1 TIME 40 (of 50) ]
[ time 19 ] Run JOB 0 at PRIORITY 1 [ TICKS 9 ALLOT 1 TIME 40 (of 50) ]
[ time 20 ] Run JOB 0 at PRIORITY 1 [ TICKS 8 ALLOT 1 TIME 39 (of 50) ]
[ time 21 ] Run JOB 0 at PRIORITY 1 [ TICKS 7 ALLOT 1 TIME 38 (of 50) ]
[ time 22 ] Run JOB 0 at PRIORITY 1 [ TICKS 6 ALLOT 1 TIME 37 (of 50) ]
[ time 23 ] Run JOB 0 at PRIORITY 1 [ TICKS 5 ALLOT 1 TIME 36 (of 50) ]
[ time 24 ] Run JOB 0 at PRIORITY 1 [ TICKS 4 ALLOT 1 TIME 35 (of 50) ]
[ time 25 ] Run JOB 0 at PRIORITY 1 [ TICKS 3 ALLOT 1 TIME 34 (of 50) ]
[ time 26 ] Run JOB 0 at PRIORITY 1 [ TICKS 2 ALLOT 1 TIME 33 (of 50) ]
[ time 27 ] Run JOB 0 at PRIORITY 1 [ TICKS 1 ALLOT 1 TIME 32 (of 50) ]
[ time 28 ] IO_START by JOB 0
IO DONE
[ time 28 ] Run JOB 1 at PRIORITY 0 [ TICKS 9 ALLOT 1 TIME 39 (of 50) ]
[ time 29 ] IO_DONE by JOB 0
[ time 29 ] Run JOB 0 at PRIORITY 1 [ TICKS 9 ALLOT 1 TIME 31 (of 50) ]
[ time 30 ] Run JOB 0 at PRIORITY 1 [ TICKS 8 ALLOT 1 TIME 30 (of 50) ]
[ time 31 ] Run JOB 0 at PRIORITY 1 [ TICKS 7 ALLOT 1 TIME 29 (of 50) ]
[ time 32 ] Run JOB 0 at PRIORITY 1 [ TICKS 6 ALLOT 1 TIME 28 (of 50) ]
[ time 33 ] Run JOB 0 at PRIORITY 1 [ TICKS 5 ALLOT 1 TIME 27 (of 50) ]
[ time 34 ] Run JOB 0 at PRIORITY 1 [ TICKS 4 ALLOT 1 TIME 26 (of 50) ]
[ time 35 ] Run JOB 0 at PRIORITY 1 [ TICKS 3 ALLOT 1 TIME 25 (of 50) ]
[ time 36 ] Run JOB 0 at PRIORITY 1 [ TICKS 2 ALLOT 1 TIME 24 (of 50) ]
[ time 37 ] Run JOB 0 at PRIORITY 1 [ TICKS 1 ALLOT 1 TIME 23 (of 50) ]
[ time 38 ] IO_START by JOB 0
IO DONE
[ time 38 ] Run JOB 1 at PRIORITY 0 [ TICKS 8 ALLOT 1 TIME 38 (of 50) ]
[ time 39 ] IO_DONE by JOB 0
[ time 39 ] Run JOB 0 at PRIORITY 1 [ TICKS 9 ALLOT 1 TIME 22 (of 50) ]
[ time 40 ] Run JOB 0 at PRIORITY 1 [ TICKS 8 ALLOT 1 TIME 21 (of 50) ]
[ time 41 ] Run JOB 0 at PRIORITY 1 [ TICKS 7 ALLOT 1 TIME 20 (of 50) ]
[ time 42 ] Run JOB 0 at PRIORITY 1 [ TICKS 6 ALLOT 1 TIME 19 (of 50) ]
[ time 43 ] Run JOB 0 at PRIORITY 1 [ TICKS 5 ALLOT 1 TIME 18 (of 50) ]
[ time 44 ] Run JOB 0 at PRIORITY 1 [ TICKS 4 ALLOT 1 TIME 17 (of 50) ]
[ time 45 ] Run JOB 0 at PRIORITY 1 [ TICKS 3 ALLOT 1 TIME 16 (of 50) ]
[ time 46 ] Run JOB 0 at PRIORITY 1 [ TICKS 2 ALLOT 1 TIME 15 (of 50) ]
[ time 47 ] Run JOB 0 at PRIORITY 1 [ TICKS 1 ALLOT 1 TIME 14 (of 50) ]
[ time 48 ] IO_START by JOB 0
IO DONE
[ time 48 ] Run JOB 1 at PRIORITY 0 [ TICKS 7 ALLOT 1 TIME 37 (of 50) ]
[ time 49 ] IO_DONE by JOB 0
[ time 49 ] Run JOB 0 at PRIORITY 1 [ TICKS 9 ALLOT 1 TIME 13 (of 50) ]
[ time 50 ] Run JOB 0 at PRIORITY 1 [ TICKS 8 ALLOT 1 TIME 12 (of 50) ]
[ time 51 ] Run JOB 0 at PRIORITY 1 [ TICKS 7 ALLOT 1 TIME 11 (of 50) ]
[ time 52 ] Run JOB 0 at PRIORITY 1 [ TICKS 6 ALLOT 1 TIME 10 (of 50) ]
[ time 53 ] Run JOB 0 at PRIORITY 1 [ TICKS 5 ALLOT 1 TIME 9 (of 50) ]
[ time 54 ] Run JOB 0 at PRIORITY 1 [ TICKS 4 ALLOT 1 TIME 8 (of 50) ]
[ time 55 ] Run JOB 0 at PRIORITY 1 [ TICKS 3 ALLOT 1 TIME 7 (of 50) ]
[ time 56 ] Run JOB 0 at PRIORITY 1 [ TICKS 2 ALLOT 1 TIME 6 (of 50) ]
[ time 57 ] Run JOB 0 at PRIORITY 1 [ TICKS 1 ALLOT 1 TIME 5 (of 50) ]
[ time 58 ] IO_START by JOB 0
IO DONE
[ time 58 ] Run JOB 1 at PRIORITY 0 [ TICKS 6 ALLOT 1 TIME 36 (of 50) ]
[ time 59 ] IO_DONE by JOB 0
[ time 59 ] Run JOB 0 at PRIORITY 1 [ TICKS 9 ALLOT 1 TIME 4 (of 50) ]
[ time 60 ] Run JOB 0 at PRIORITY 1 [ TICKS 8 ALLOT 1 TIME 3 (of 50) ]
[ time 61 ] Run JOB 0 at PRIORITY 1 [ TICKS 7 ALLOT 1 TIME 2 (of 50) ]
[ time 62 ] Run JOB 0 at PRIORITY 1 [ TICKS 6 ALLOT 1 TIME 1 (of 50) ]
[ time 63 ] Run JOB 0 at PRIORITY 1 [ TICKS 5 ALLOT 1 TIME 0 (of 50) ]
[ time 64 ] FINISHED JOB 0
[ time 64 ] Run JOB 1 at PRIORITY 0 [ TICKS 5 ALLOT 1 TIME 35 (of 50) ]
[ time 65 ] Run JOB 1 at PRIORITY 0 [ TICKS 4 ALLOT 1 TIME 34 (of 50) ]
[ time 66 ] Run JOB 1 at PRIORITY 0 [ TICKS 3 ALLOT 1 TIME 33 (of 50) ]
[ time 67 ] Run JOB 1 at PRIORITY 0 [ TICKS 2 ALLOT 1 TIME 32 (of 50) ]
[ time 68 ] Run JOB 1 at PRIORITY 0 [ TICKS 1 ALLOT 1 TIME 31 (of 50) ]
[ time 69 ] Run JOB 1 at PRIORITY 0 [ TICKS 0 ALLOT 1 TIME 30 (of 50) ]
[ time 70 ] Run JOB 1 at PRIORITY 0 [ TICKS 9 ALLOT 1 TIME 29 (of 50) ]
[ time 71 ] Run JOB 1 at PRIORITY 0 [ TICKS 8 ALLOT 1 TIME 28 (of 50) ]
[ time 72 ] Run JOB 1 at PRIORITY 0 [ TICKS 7 ALLOT 1 TIME 27 (of 50) ]
[ time 73 ] Run JOB 1 at PRIORITY 0 [ TICKS 6 ALLOT 1 TIME 26 (of 50) ]
[ time 74 ] Run JOB 1 at PRIORITY 0 [ TICKS 5 ALLOT 1 TIME 25 (of 50) ]
[ time 75 ] Run JOB 1 at PRIORITY 0 [ TICKS 4 ALLOT 1 TIME 24 (of 50) ]
[ time 76 ] Run JOB 1 at PRIORITY 0 [ TICKS 3 ALLOT 1 TIME 23 (of 50) ]
[ time 77 ] Run JOB 1 at PRIORITY 0 [ TICKS 2 ALLOT 1 TIME 22 (of 50) ]
[ time 78 ] Run JOB 1 at PRIORITY 0 [ TICKS 1 ALLOT 1 TIME 21 (of 50) ]
[ time 79 ] Run JOB 1 at PRIORITY 0 [ TICKS 0 ALLOT 1 TIME 20 (of 50) ]
[ time 80 ] Run JOB 1 at PRIORITY 0 [ TICKS 9 ALLOT 1 TIME 19 (of 50) ]
[ time 81 ] Run JOB 1 at PRIORITY 0 [ TICKS 8 ALLOT 1 TIME 18 (of 50) ]
[ time 82 ] Run JOB 1 at PRIORITY 0 [ TICKS 7 ALLOT 1 TIME 17 (of 50) ]
[ time 83 ] Run JOB 1 at PRIORITY 0 [ TICKS 6 ALLOT 1 TIME 16 (of 50) ]
[ time 84 ] Run JOB 1 at PRIORITY 0 [ TICKS 5 ALLOT 1 TIME 15 (of 50) ]
[ time 85 ] Run JOB 1 at PRIORITY 0 [ TICKS 4 ALLOT 1 TIME 14 (of 50) ]
[ time 86 ] Run JOB 1 at PRIORITY 0 [ TICKS 3 ALLOT 1 TIME 13 (of 50) ]
[ time 87 ] Run JOB 1 at PRIORITY 0 [ TICKS 2 ALLOT 1 TIME 12 (of 50) ]
[ time 88 ] Run JOB 1 at PRIORITY 0 [ TICKS 1 ALLOT 1 TIME 11 (of 50) ]
[ time 89 ] Run JOB 1 at PRIORITY 0 [ TICKS 0 ALLOT 1 TIME 10 (of 50) ]
[ time 90 ] Run JOB 1 at PRIORITY 0 [ TICKS 9 ALLOT 1 TIME 9 (of 50) ]
[ time 91 ] Run JOB 1 at PRIORITY 0 [ TICKS 8 ALLOT 1 TIME 8 (of 50) ]
[ time 92 ] Run JOB 1 at PRIORITY 0 [ TICKS 7 ALLOT 1 TIME 7 (of 50) ]
[ time 93 ] Run JOB 1 at PRIORITY 0 [ TICKS 6 ALLOT 1 TIME 6 (of 50) ]
[ time 94 ] Run JOB 1 at PRIORITY 0 [ TICKS 5 ALLOT 1 TIME 5 (of 50) ]
[ time 95 ] Run JOB 1 at PRIORITY 0 [ TICKS 4 ALLOT 1 TIME 4 (of 50) ]
[ time 96 ] Run JOB 1 at PRIORITY 0 [ TICKS 3 ALLOT 1 TIME 3 (of 50) ]
[ time 97 ] Run JOB 1 at PRIORITY 0 [ TICKS 2 ALLOT 1 TIME 2 (of 50) ]
[ time 98 ] Run JOB 1 at PRIORITY 0 [ TICKS 1 ALLOT 1 TIME 1 (of 50) ]
[ time 99 ] Run JOB 1 at PRIORITY 0 [ TICKS 0 ALLOT 1 TIME 0 (of 50) ]
[ time 100 ] FINISHED JOB 1

Final statistics:
Job  0: startTime   0 - response   0 - turnaround  64
Job  1: startTime   0 - response   9 - turnaround 100

Avg  1: startTime n/a - response 4.50 - turnaround 82.00

### 5

python ./mlfq.py -n 2 --jlist 0,50,9:0,50,0 -q 10 -S -B 1 -i 1 -c

### 6

python ./mlfq.py -n 2 --jlist 0,50,1:0,50,0 -q 10 -i 1 -I -c

Final statistics:
Job  0: startTime   0 - response   0 - turnaround  99
Job  1: startTime   0 - response   1 - turnaround 100

Avg  1: startTime n/a - response 0.50 - turnaround 99.50