The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.

This book explain the role of OS as a resource manager.

Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by norima2305, 2021-11-28 00:37:23

Resource Management Operating System

This book explain the role of OS as a resource manager.

Keywords: Resource

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 also known as 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. CPU Scheduling decisions may take place under what circumstances?
30. Under non-pre-emptive scheduling, once the CPU has been allocated to a

process, the process keeps the 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. From the point of view of a particular process, the important criterion is how

long it takes to executer that process. The interval from the time of submission
of a process to the time of completion is the ___________?
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 of the scheduling algorithm the average waiting time for the process to
start execution is often quiet long?

43 | P a g e

43. Which of the scheduling algorithm associates with each process the length of
the process’s next CPU burst?

44. Is Shortest Job First (SJF) scheduling algorithm pre-emptive?
45. Among the scheduling algorithms, which is used regularly in long-term

scheduling?
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. In Round Robin scheduling algorithm, the process may have a CPU burst time

of less than 1 time quantum. Explain this.
50. Consider the following set of processes, with the length of the CPU-burst time

given in milliseconds:

Table 1

Process Burst Priority
Time
P1 3
P2 10 1
P3 1 3
P4 2 4
P5 1 2
5

44 | P a g e

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)?

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

45 | P a g e

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?
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. operating system is a software that control and manages a computer’s
hardware. It also provides a platform and basis for application programs and
acts as an 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 managements involve the execution of various tasks such as creation
of processes, scheduling of processes, management of deadlock, and
termination of processes. It is responsibility of operating system to manage all
the running processes of the system

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.

47 | P a g e

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.

8. Interrupt is a signal emitted by hardware or software when a process or an
event needs immediate attention. It alerts the processor to a high-priority
process requiring interruption of the current working process. In Input/output
devices one of the bus control lines is dedicated for this purpose and is called
the Interrupt Service Routine (ISR).

9. When a device raises an interrupt at let’s say process i, the processor first
completes the execution of instruction i. Then it loads the Program Counter
(PC) with the address of the first instruction of the ISR. Before loading the
Program Counter with the address, the address of the interrupted instruction
is moved to a temporary location. Therefore, after handling the interrupt the
processor can continue with process i+1. Pointer, process state, process
number, program counter, registers, memory limits, open file list and
Miscellaneous 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.

48 | P a g e

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.
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 have some process running at all times and to maximize CPU utilization
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 issue an input/output request and then be placed in an

input/output queue. The process could create a new child process and wait for
the child’s termination. The process could be removed forcibly from the CPU,
as a result of an interrupt, and be put back in 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 is also known as CPU scheduler and is responsible for
selecting one process from the ready state for scheduling it on the running
state.
25. Medium-term schedulers are those schedulers whose decision will have a mid-
term effect on the performance of the system. It is responsible for swapping
of a process from the Main Memory to Secondary Memory and vice-versa.

49 | P a g e

26. Differences as table 4:

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

50 | P a g e

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. Ready queue. As we shall see when we consider the various scheduling

algorithm, a ready queue can be implemented as a FIFO queue, a priority
queue etc. Conceptually, however, all the processes in the ready queue are
lined up waiting for a chance to run on the CPU. The records in the queues are
generally process control blocks (PCBs) of the processes.
31. Dispatcher
32. CPU Utilization, Throughput, Turnaround time, waiting time and response
time.
33. CPU utilization
34. Throughput
35. Turnaround time. Turnaround time is the sum of the periods spent waiting to
get into memory, waiting in the ready queue, executing on the CPU and doing
I/O.
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

51 | P a g e

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
RR:

SJF:

Priority:

52 | P a g e

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

c. Waiting time (turnaround time minus burst time)

PROCESS FCFS/ RR SJF Priority
FIFO
P1 9 96
P2 0 1 00
P3 10 5 2 16
P4 11 3 1 18
P5 13 9 41
14

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

53 | P a g e

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 : Simple and fair (as long as no process hogs the CPU, every process
will eventually run)
Disadvantages : Waiting time depends on arrival order. Short processes stuck
waiting for long process to complete.
56. Advantages : Minimizes average waiting time and response time
Disadvantages : Not practical, difficult to predict burst time and may starve
long jobs.
57. Average waiting time = 4.25 ms
Average response time = 1.5 ms

54 | 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

55 | 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

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 Wan Tahir
Lecturer
Department of Electrical Engineering

Department of electrical Engineering
Politeknik Sultan Idris Shah


Click to View FlipBook Version