12/04/2022, 09:28 Exam/Scheduling – COMP3231/COMP9201/COMP3891/COMP9283
Scheduling
1. Scheduling
1. Why is it generally correct to favour I/O bound
Copyright By PowCoder代写 加微信 powcoder
processes over CPU-bound processes?
2. What is the difference between preemptive
scheduling and non-preemptive scheduling?
What is the issue with the latter?
3. Describe round robin scheduling. What is the
parameter associated with the scheduler? What
are the issues in choosing the parameter?
4. The traditional UNIX scheduler is a priority-
based round robin scheduler (also known as a multi-level round robin scheduler). How does the scheduler go about favouring I/O bound jobs over long-running CPU-bound jobs?
Why is it generally correct to favour I/O bound processes over CPU-bound processes?
Running an IO-bound process before a CPU-bound process will not significantly delay the CPU-bound process because the IO-bound process spends most of its time waiting on IO requests to complete. Hence IO-bound processes tend to block on IO requests, allowing the subsequent CPU-bound process to run.
On the other hand, running a CPU-bound process before an IO-bound process will delay the IO-bound process significantly since it must wait for the CPU-bound process to finish its current chunk of computation before it can run.
What is the difference between preemptive scheduling and non-preemptive scheduling? What is the issue with the latter?
In pre-emptive scheduling, the OS can interrupt the current process and move it to a ready state. This usually occurs at the end of its timeslice or when a higher priority process is unblocked.
In non-preemptive scheduling, a process runs until it completes, blocks or yields. This type of scheduling is vulnerable to being monopolised by one process.
Describe round robin scheduling. What is the parameter associated with the scheduler? What are the issues in choosing the parameter?
A round robin scheduler runs each process for timeslice t, then preempts it and puts it on the end of a ready queue. Then runs the next process for timeslice t.
https://wiki.cse.unsw.edu.au/cs3231cgi/Exam/Scheduling
12/04/2022, 09:28 Exam/Scheduling – COMP3231/COMP9201/COMP3891/COMP9283
If the timeslice is too large, the system is unresponsive. If it is too small, then too much time is wasted context switching.
The traditional UNIX scheduler is a priority-based round robin scheduler (also known as a multi-level round robin scheduler). How does the scheduler go about favouring I/O bound jobs over long-running CPU-bound jobs?
In the traditional UNIX scheduler, each process is assigned a UNIX priority number. Processes with lower UNIX priority numbers have higher priority. It is calculated as follows:
Priority number = CPU Usage + Nice + Base
CPU usage measures the number of clock ticks used by the process.
Nice is a permanent user-defined value.
Base is a large hard-wired value used to boost the priority of system IO-bound processes.
The scheduler favours IO bound jobs over CPU bound jobs in two ways. Firstly, processes that use the CPU are directly penalised by the inclusion of CPU usage in the priority number calculation. This disproportionately affects CPU-bound jobs. Secondly, the base is a large number that penalises most processes in order to boost the priority of system IO-bound processes.
Exam/Scheduling (last edited 2020-08-19 15:32:00 by KevinElphinstone)
https://wiki.cse.unsw.edu.au/cs3231cgi/Exam/Scheduling
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com