scheduling.
Answer:
The short-term scheduler selects from the ready processes the next process to run
and gives it the CPU. The long-term scheduler selects from the pool of processes
that are waiting on disk and loads the selected process(es) into memory. These
processes have not yet begun their execution. The medium-term scheduler takes
processes that are currently in memory and selects those to be swapped out to
disk. These processes will be swapped back in at a later point. This is done to
improve process mix or because of memory requirements (i.e., overcommitted
and needs to free up memory).
A primary difference is in the frequency of their execution. The short-term
scheduler must select a new process quite often. Long-term is used much
less often since it handles placing jobs in the system and may wait a while
for a job to finish before it admits another one.
P1
FCFS
SJF
P2 P4
10
11
P2
5
P3
10
12
P3
11
13
14
15
P4
12
13
16
17
18
19
P5
14
15
16
17
18
19
P1
P5
Non-preemptive
Priority
0
P2
10
P5
11
12
13
14
15
16
P1
17
P3
18
19
P4
RR Quantum = 1
0
10
11
12
13
14
15
16
17
18
19
b. Turnaround time
P1
P2
P3
P4
P5
FCFS
RR
SJF
Priority
10
11
13
14
19
19
2
7
4
14
19
1
4
2
9
16
1
18
19
6
FCFS
RR
SJF
0
10
11
13
14
9
1
5
3
9
9
0
2
1
4
Priority
6
0
16
18
1
assigned quantum, but relinquish the CPU before the end of the quantum,
thereby increasing the priority associated with the process.