QUESTION
1. What is the function of Operating system?
2. How Operating system can relate to Resources Management.
3. What is the meaning of Resources Management?
4. Explain the process management
5. What is the role of interrupt?
6. Why are interrupts important?
7. What is interrupt example?
8. Explain how interrupt works
9. What information inside Process Control Block (PCB)
10. Explain the function of Process Control Block (PCB)
11. A process can be terminated due to normal exit state. How can this state
happen?
12. What is the process of ready state?
13. What do you mean by a process?
14. What are the different states of a process?
15. What is the advantage of a multiprocessor system?
16. How many the necessary and sufficient conditions behind the deadlock?
Explain each.
17. What is deadlock? Explain
18. The address of the next instruction to be executed for the current process is
stored in?
19. What state of process defined “The process is waiting to be assigned to a
processor”
41 | P a g e
20. What state of process defined “The process has finished execution”
21. What is the objective of multiprogramming?
22. What will happen if a computer have single-processor system
23. What event could occur once the process is allocated the CPU and is executing?
24. Long-Term Scheduler is a Job Scheduler. Its responsibility is controlled the
Multiprogramming degree by maintaining the total number of processes in the
ready state. What is the function of Long-Term Scheduler?
25. What is the function of short-term schedulers?
26. A running process sometimes need to send into ready state or to wait/block
state. For example, in the Round Robin Scheduling Algorithm, after a process
completed fixed time quantum, the process is then send again to the ready
state from the running state. This scheme are fulfil by the help of Medium-
Term schedulers. So, Medium-Term schedulers can be defined as?
27. Make a list the difference between the long-term, short-term, and medium-
term schedulers
28. Based on Figure 4.1 below, which part for Short-term scheduling?
Figure 4.1
42 | P a g e
29. When can CPU scheduling decisions be made?
30. In non-preemptive scheduling, a process keeps its CPU until?
31. Whenever the CPU becomes idle, the operating system must select on of the
process in the __________to be executed.
32. The ______________is the module that gives control of the CPU to the process
selected by the short-term scheduler.
33. What is the criteria for comparing CPU-scheduling algorithm?
34. We want to keep CPU as busy as possible, this criteria refers to?
35. If the CPU is busy executing process, then work is being done. One measure of
work is the number of processes that are completed per time, called________?
36. The time it takes to execute a procedure is an important factor. What is the
time interval between submission and completion of a process?
37. _____________is the sum of periods spent waiting in the ready queue.
38. Another measure is the time from the submission of a request until the first
response is produced. This measure is called____________?
39. What is the best situation in CPU-scheduling algorithm?
40. What is the algorithm that requests the CPU first allocated?
41. Is FIFO/FCFS algorithm is non-preemptive?
42. Which scheduling strategy has the longest average wait time for the procedure
to start?
43. Which scheduling technique assigns each process the next CPU burst length?
44. Is Shortest Job First (SJF) scheduling algorithm pre-emptive?
45. Among the scheduling algorithms, which is used regularly in long-term
scheduling?
43 | P a g e
46. ______________is sometimes called shortest remaining time first scheduling.
47. Which of the scheduling algorithm has a major problem like indefinite blocking
or starvation?
48. Which scheduling algorithm that is designed especially for times-haring
system?
49. Processes with CPU burst times under 1 time quantum may be scheduled using
Round Robin. Describe.
50. For each process, the CPU-burst time is indicated in milliseconds:Table 1
Process Burst Priority
Time
P1 3
P2 10 1
P3 1 3
P4 2 4
P5 1 2
5
The processes are assumed to have arrived in the order P1,P2,P3,P4,P5, all at
time 0.
a) Draw four Gantt charts illustrating the execution of these processes using
FCFS, SJF, a non-preemptive priority (a smaller priority number is higher
priority), and RR(quantum=1) scheduling.
b) States the turnaround time of each process for each of the scheduling
algorithms in a)?
c) States the waiting time of each process for each of the scheduling
algorithms in a)?
44 | P a g e
d) Which of the schedules in part a result in the minimal average waiting time
(over all processes)?
51. Consider the below set of processes that arrive at time zero. The length of the
CPU burst time given in millisecond. Now calculate average waiting time if CPU
is using FIFO scheduling algorithm.
Table 2
Process Burst Time
(ms)
P1 5
P2 24
P3 16
P4 10
P5 3
52. By using set of processes at Table 2, calculate the average waiting time if CPU
is using SJF scheduling algorithm.
53. By using set of processes at Table 2, calculate the average waiting time if CPU
is using SRTF scheduling algorithm.
54. By using set of processes at Table 2, calculate the average waiting time if CPU
is using Priority scheduling algorithm.
55. What are advantages and disadvantages FIFO Scheduling algorithm?
56. What are advantages and disadvantages SJF (no-preemption) Scheduling
algorithm?
45 | P a g e
57. Calculate average waiting time and average response time for the set
processes in Table 3. The CPU is using Round Robin scheduling algorithm with
time slice = 2.
Process Table 3
Arrival time Burst Time
P1
P2 (ms) (ms)
P3 07
P4 24
32
91
46 | P a g e
ANSWERS
1. An operating system controls and manages a computer's hardware. It also
works as a intermediary between the computer user and the computer
hardware.
2. An operating system operates by managing all the process of the resources
such as memory information, input output devices, processor and file so that
the electronic devices can work in excellent manner. The operating system
acts as the resource manager for the resources and allocates them to specific
programs to complete the task as necessary.
3. Resource management is the process in all operating systems in which system
resources (such as random-access memory, Central Processing Unit (CPU),
secondary storage devices, external devices and so on) is assigned to specific
processes, threads, and applications. This is usually done to achieve high
throughput, quality of service, fairness and balance between all processes. To
complete the task, several scheduling algorithms is needed to the processes
and share the system resources equally as required. This scheduling level task
is the basic requirement for the systems to performed multitasking and
multiplexing.
4. Process management activities include process creation, scheduling, deadlock
management, and termination. The operating system is in charge of managing
all system processes.
5. Interrupts is a signal sent by external devices such as keyboard, mouse, scanner
to the CPU by external devices to tell the CPU to stop its current process and
execute another.
6. Interrupts are important because the user no need to wait the application
which have higher priority over the CPU to be run. Interrupt also give the user
better control of the computer.
7. The definition of an interrupt is a computer signal that tells the computer to
stop running the current program and run another. An example of an interrupt
is to stop Microsoft Word apps so that a PowerPoint presentation take part.
47 | P a g e
8. It is used to indicate that a procedure or occurrence need quick attention. It
informs the processor of a high-priority task that must be interrupted. The
Interrupt Service Routine is a dedicated bus control line in input/output
devices (ISR).
9. When a device interrupts process i the CPU initially finishes instruction i. Then
it loads the PC with the ISR's first instruction's address. The address of the
interrupted instruction is temporarily shifted before loading it into the
Program Counter. So, after managing the interrupt, process i+1 can proceed.
Registers, memory limitations, open file list, and other accounting and status
data.
10. A process control block (PCB) is a data structure used by computer operating
systems to store all the information about a process.
11. A process can be terminated normally by completing its task or because of
fatal error or killed by another process or forcefully killed by a user. When the
process completes its task without any error then it exits normally. The
process may exit abnormally because of the occurrence of fatal error while it
is running. The process can be killed or terminated forcefully by another
process.
12. An executing program
13. New Process, Ready Process, Waiting Process, Running Process, Terminated
Process
14. When processors are increased, the considerable increment in throughput. It
is cost effective because they can share resources. So, the reliability can
increase.
15. i) Mutual Exclusion Condition: It specifies that the resources involved are non-
sharable.
ii) Hold and Wait Condition: It specifies that there must be a process that is
holding a resource already allocated to it while waiting for additional resource
that are currently being held by other processes.
iii) Non-Pre-emptive Condition: Resources cannot be taken away while they
are being used by processes.
48 | P a g e
iv) Circular Wait Condition: It is an explanation of the second condition. It
specifies that the processes in the system form a circular list or a chain where
each process in the chain is waiting for a resource held by next process in the
chain.
16. Deadlock is a specific situation or condition where two processes are waiting
for each other to complete before they can start. This situation can causes
hang.
17. Program Counter
18. Ready state
19. Terminated State
20. To always keep a process running and maximise CPU utilisation
21. There will never be more than one running process. If more processes, the rest
will have to wait until the CPU is free and can be rescheduled.
22. The process could send an input/output request and be queued. It might start
a new child process and wait for it to finish. An interrupt could force the
process off the CPU and back into the ready queue.
23. The long-term scheduler decides which process is to be created to put into the
ready state.
24. Short-Term Scheduler or CPU scheduler is responsible for selecting one
process from the ready state for scheduling it on the running state.
25. Medium-term schedulers are those whose decisions have a mid-term effect on
system performance. It is responsible for swapping of a process from the Main
Memory to Secondary Memory and vice-versa.
26. Differences as table 4:
49 | P a g e
Table 4
LONG TERM SHORT TERM MEDIUM TERM
Also known as job Also called as swapping
scheduler Also known as CPU scheduler
It is either absent or scheduler It is an element of time-
minimal in a time-sharing It is significant in the sharing system
system time-sharing order
Speed is less Speed is medium
Speed is fastest
Allow to select a process comparing the two It helps to send process
from the load and pool schedulers back to memory
back into memory Only select the process
Offers full control reside in ready state of Reduce the level of
the execution multiprogramming
Offers less control
27. Short-term scheduler is located between Ready State and Running state
Figure 4.1
28. When a process switches from the running state to waiting state. When a
process switches from the running state to ready state. When a process
switches from the waiting state to ready state. When a process terminates.
29. It releases the CPU by terminating or by switching to the waiting state
30. A ready queue can be implemented as a FIFO queue, a priority queue, etc. But
conceptually, the ready queue is a line of processes waiting for a chance to run
on the CPU. Queue records are often process control blocks (PCBs).
50 | P a g e
31. Dispatcher
32. CPU Utilization, Throughput, Turnaround time, waiting time and response
time.
33. CPU utilization
34. Throughput
35. Turnaround time or Time to complete. Turnaround time is the sum of time
spent waiting in memory, ready queue, CPU, and input/output.
36. Waiting time
37. Response time
38. Response time. It is the time takes to start responding, not the time it takes to
output the response.
39. Maximize CPU utilization and throughput and to minimize turnaround time,
waiting time and response time is the best situation in CPU-scheduling
algorithm.
40. FIFO/FCFS
41. Yes
42. FIFO/FCFS
43. Shortest Job First Scheduling (SJF)
44. SJF algorithm can be preemptive or non-preemptive
45. Shortest Job First Scheduling (SJF)
46. Preemptive SJF scheduling
47. Priority scheduling algorithm
48. Round Robin scheduling algorithm.
49. The process will release the CPU voluntarily. The scheduler will then proceed
to the next process in the ready queue.
50. The four Gantt charts are:
FCFS/FIFO
51 | P a g e
RR:
SJF:
Priority:
b. Turnaround time
PROCESS FCFS/ RR SJF Priority
FIFO
P1 10 19 19 16
P2 11 2 11
P3 13 7 4 18
P4 14 4 2 19
P5 19 14 96
52 | P a g e
c. Waiting time (turnaround time minus burst time)
PROCESS FCFS/ RR SJF Priority
FIFO
6
P1 0 9 9 0
16
P2 10 1 0 18
1
P3 11 5 2
P4 13 3 1
P5 14 9 4
d. Shortest Job First
51. Waiting time each process:
P1 = 0
P2 = 5 ms
P3 = 29 ms
P4 = 45 ms
P5 = 55 ms
Average waiting time = 25 ms
52. Average waiting time = 12.6 ms
53. Average waiting time = 3.2 ms
54. Average waiting time = 10 ms
55. FIFO Scheduling algorithm advantages and disadvantages.
Advantages : very Simple and fair
Disadvantages : Waiting time depends on arrival order. Short processes stuck
waiting for long process to complete.
56. Advantages : average waiting and response time can be minimizes
Disadvantages : This scheduling is not practical and difficult to predict burst
time. Besides starve long jobs can occur.
57. Average waiting time = 4.25 ms
Average response time = 1.5 ms
53 | P a g e
REFERENCES
K.Hameed, A.Haider, A.Ali (2017) Resource Management in Operating Systems - A
Survey of Scheduling Algorithms, ResearchGate
A. Silberschatz, P. B. Galvin, G. Gagne, (2018) Operating System Concepts, 10th
Edition, Wiley
54 | P a g e
CREDITS
Figure 2.5, 2.6, 2.7, 3.1 & 3.2 : From A. Silberschatz, P. B. Galvin, G. Gagne,
Operating System Concepts, 10th Edition, Wiley 2018
55 | P a g e
56 | P a g e
THIS BOOK explains the role of the modern Operating System as a
Resource Manager to create multiprogramming environment. The
resource such as CPU, Memory unit, Registers, Storage devices and
input/output devices. These involves several execution processes to
complete a required task. To complete a task, OS need a good
process management and suitable CPU scheduling algorithm, so that
the computer can run in excellent manner as well as can overcome
the deadlock situation.
This book is published according to the polytechnic syllabus, and it
is very suitable for students to understand the basic of Resource
Management in Operating System.
Nor Ima Nor Shah
Lecturer
Department of Electrical Engineering
Wan Norhayati Bt Wan Tahir
Lecturer
Department of Electrical Engineering