Professional Documents
Culture Documents
Operating Systems
Sheet 10
Process Scheduling
1.
• Small quantum: favors short processes and more
overhead due to frequent context switching.
• Large quantum: favors long processes and poor
performance for short interactive requests.
2. An I/O‐bound process getting serviced as it reaches the head
of the first queue typically is allocated enough processor time
to generate its next I/O request and leave the queuing network,
so I/O‐bound processes receive the kind of immediate (yet
brief) service they require to keep I/O device utilization high.
Processor‐bound processes rapidly sink to the lower‐priority
queues, where they “get out of the way” of I/O‐bound
processes requiring fast service.
3. Setting longer time quantum sizes at lower priority levels in a
multilevel scheduling system helps prevent starvation of long
processes by allowing them to execute for extended periods
without being preempted by higher-priority tasks. This ensures
that lower-priority processes have a fair chance to make
progress and complete their execution.
4.
a. It uses the technique of aging; a process’s priority increases
the longer it waits for service.
b. Again, a process’s priority increases as it waits, so a long
process that has been waiting for some time may eventually get
a higher priority than even newly arriving short processes.
c. Only if their anticipated service times are identical. If not,
then the process with the shorter service time will have higher
priority.
5.
a. A process that runs for some time falls to lower‐priority
queues as it continues executing.
Shorter processes remain in the higher‐priority queues until
they are complete, then they leave the queuing network. A
process in a lower‐priority queue executes only if no processes
are waiting in higher priority queues.
b. I/O‐bound processes use only a small amount of processor
time before generating an I/O request and leaving the queuing
network, so they receive priority similar to shorter processes.
c. The primary distinction is between I/O‐bound and processor‐
bound processes. An I/O‐bound process getting serviced as it
reaches the head of the first queue typically is allocated enough
processor time to generate its next I/O request and leave the
queuing network, so I/O‐bound processes receive the kind of
immediate (yet brief) service they require to keep I/O device
utilization high. Processor‐bound processes rapidly sink to the
lower‐priority queues, where they “get out of the way” of I/O‐
bound processes requiring fast service.
6.
a.
• Shortest Remaining Time:
• Non-preemptive Priority:
b.
• Shortest Remaining Time (20+0+70+10)/4 = 25ms)
• Non-preemptive Priority (0+30+10+70)/4 = 27.5ms)
• Round Robin with quantum of 30 ms (20+10+70+70)/4 =
42.5ms)
7.
a. Optimal: when there is high variance in processes execution
times. So when short processes come first. Pessimal: when
there is high variance in processes execution times. So when
long processes come first.
b. Optimal: it always provides good response times for short
processes. Pessimal: none.
c. Optimal: it always provides good response times for short
processes. Pessimal: it may cause starvation to long processes
and will result in bad response times.
d. Optimal: it provides good response times for short processes.
Pessimal: none.
8.
a.