April 1999
SW204: SOFTWARE AND FILES DESIGN

QUESTION 2

Total Marks: 20 Marks

Click here to access other questions

GRADE A
Sample student's solutions are indicated in green.
Return to Question 2

 

(a) Name and briefly describe the primary and secondary goals of an operating system. In both cases, describe how these goals may be achieved. [4]
(i) To make the computer system convenient to use.
By achieving this goal, operating system will presents the users with a virtual machine that is easy to program.

(ii) To use the computer hardware in an efficient manner.
To achieve this, operating system provides an orderly and controlled allocation of resources, such as processor, memory and I/O devices among various processes that are competing in a multi-user environment.

 

(b) (i) What is the purpose of a scheduler? [1]
(ii) describe three main objectives of scheduling. [3]
(i) The purpose of scheduler is to decide which process to be allocated to the CPU for execution.

(ii) Scheduling objectives:
a) Fairness - to ensure each process has a fair share use of the CPU.
b) Response Time - to minimize the response time for interactive users.
c) Efficiency - since CPU is expensive so scheduling has to ensure that the CPU is 100 % utilize; busy all the time.

 

(c) Describe two characteristics of each of the following scheduling algorithms:
(i) First come first served. [2]
(ii) Shortest job first. [2]
(iii) Round robin. [2]
(iv) Priority scheduling. [2]
(i) First come first served
- the process that requests for the CPU first, the CPU is allocated to it first.

(ii) Shortest job first
- if the CPU is available, it is allocated to the process which has the shortest CPU burst time.

(iii) Round Robin
- it is applicable in time-sharing environment.
- a small unit of time, called time quantum or time slice is defined.
- the scheduler will go through the process request list, allocating CPU to each of them for a time interval up to a quantum length.

(iv) Priority Scheduling
- each process is assigned with a priority
- CPU is allocated to the process that has the highest priority.

 

(d) (i) What is the difference between preemptive and non-preemptive scheduling? [2]
(ii) Which of the above scheduling algorithms can be implemented as a non-preemptive algorithm? [2]
(i) Preemptive
In preemptive scheduling, CPU can be forcefully taken away from the process that is currently using it.

Non- preemptive
But, in non-preemptive scheduling, the process can keep the CPU as long as it wants or willingly to release the CPU when it needs I/P operation.

(ii)
a) first come first serve
b) shortest job first
c) priority scheduling