Skill Paper III Unit
Skill Paper III Unit
Systems:
we will be learning about the CPU Scheduling Algorithms in Operating
Systems. These are algorithms are very important topic in Operating Systems.
This is because this CPU Scheduling Algorithms forms a base and foundation for
the Operating Systems subject.
There are many processes which are going on in the Operating System. A
task is a group of processes. Every task is executed by the Operating System. The
Operating System divides the task into many processes. The final goal of the
Operating System is completion of the
But there are some certain conditions which must be followed by the task.
The conditions are that the Task must be finished in the quickest possible time
with the limited resources which the Operating System have. This is the main
motive of CPU Scheduling Algorithms.
CPU Scheduling:
The CPU Scheduling is the process by which a process is executed by the
using the resources of the CPU. The process also can wait due to the absence or
unavailability of the resources. These processes make the complete use of
Central Processing Unit.
The operating system must choose one of the processes in the list of ready-
to-launch processes whenever the CPU gets idle. A temporary (CPU) scheduler
does the selection. The Scheduler choose one of the ready-to-start memory
processes to get the CPU.
1. Process ID:
The Process ID is the first Thing is to be written while solving the problem. The
Process ID acts like the name of the process. It is usually represented with
numbers or P letter with numbers
Example:
0, 1, 2, 3, . . . . . . . . . .
Usually, we start the naming of the process from zero. We can also start the
numbering from number 1 also. It is our interest
1. Arrival Time:
The time which is required for the Process to enter the ready queue or the time
when the Process is ready to be executed by the CPU. This Arrival Time can be
represented as AT in short form. The Arrival Times is always positive or also zero.
2. Burst Time:
The Time Slot which the Process requires to complete the Process is known as
the Burst Time. The Burst Time can be represented as BT in short form. The Burst
Times of a process is always greater than zero.
3. Completion Time:
The Total Time required by the CPU to complete the process is known as
Completion Time. The Completion Time can be represented as CT in short form.
The Completion will always be greater than zero.
The time taken by the CPU since the Process has been ready to execute or since
the process is in Ready Queue is known as Turn Around Time. The Turn Around
Time can be calculated with the help of Completion Time and Arrival Time. The
Turn Around Time can be represented as TAT in short form.
The Turn Around Time is the difference of Completion Time and Arrival Time.
Formula:
TAT = CT - AT
The time the Process has been waiting to complete its process since the
assignment of process for completion is known as Waiting Time. The Waiting
Time can be represented as WT in short form. The Waiting Time can be
calculated with the help of Turn Around Time and Burst Time.
The Waiting Time is the difference between Turn Around Time and Burst Time.
Formula:
WT = TAT - BT
6. Ready Queue:
The Queue where all the processes are stored until the execution of the previous
process. This ready queue is very important because there would be confusion in
CPU when two same kinds of processes are being executed at the same time.
Then, in these kinds of conditions the ready queue comes into place and then,
the its duty is fulfilled.
7. Gantt Chart:
It is the place where all the already executed processes are stored. This is very
useful for calculating Waiting Time, Completion Time, Turn Around Time.
1. When a process switches from the running state to the waiting state(for
I/O request or invocation of wait for the termination of one of the child
processes).
2. When a process switches from the running state to the ready state (for
example, when an interrupt occurs).
3. When a process switches from the waiting state to the ready state(for
example, completion of I/O).
When Scheduling takes place only under circumstances 1 and 4, we say the
scheduling scheme is non-preemptive; otherwise, the scheduling scheme is
preemptive.
1. Pre-emptive Approach
We can also say that First Come First Serve CPU Scheduling Algorithm
follows First In First Out in Ready Queue.
• First Come First Serve can follow or can be executed in Pre emptive
Approach or Non-Pre emptive Approach.
• The Process which enters the Ready Queue is executed First. So, we say
that FCFS follows First in First Out Approach.
• First Come First Come First Serve is only executed when the Arrival Time
(AT) is greater than or equal to the Time which is at present.
Advantages:
Disadvantages
The Shortest Job is heavily dependent on the Burst Times. Every CPU
Scheduling Algorithm is basically dependent on the Arrival Times. Here, in this
Shortest Job First CPU Scheduling Algorithm, the CPU allots its resources to the
process which is in ready queue and the process which has least Burst Time.
If we face a condition where two processes are present in the Ready Queue
and their Burst Times are same, we can choose any process for execution. In
actual Operating Systems, if we face the same problem then sequential
allocation of resources takes place.
Characteristics:
• SJF (Shortest Job First) has the least average waiting time. This is because
all the heavy processes are executed at the last. So, because of this reason
all the very small, small processes are executed first and prevent
starvation of small processes.
• Shortest Job can be executed in Pre emptive and also non pre emptive way
also.
Advantages
• SJF is used because it has the least average waiting time than the other
CPU Scheduling Algorithms
• SJF can be termed or can be called as long term CPU scheduling algorithm.
Disadvantages
• Starvation is one of the negative traits Shortest Job First CPU Scheduling
Algorithm exhibits.
• Often, it becomes difficult to forecast how long the next CPU request will
take
Priority for Prevention The priority of a process determines how the CPU
Scheduling Algorithm operates, which is a preemptive strategy. Since the editor
has assigned equal importance to each function in this method, the most crucial
steps must come first. The most significant CPU planning algorithm relies on the
FCFS (First Come First Serve) approach when there is a conflict, that is, when
there are many processors with equal value.
Characteristics
• When a task with a lower priority is being performed while a task with a
higher priority arrives, the task with the lower priority is replaced by the
task with the higher priority, and the latter is stopped until the execution
is finished.
Advantages
• The typical or average waiting time for Priority CPU Scheduling is shorter
than First Come First Serve (FCFS).
• It is less complex
Disadvantages
The Starvation Problem is one of the Pre emptive Priority CPU Scheduling
Algorithm's most prevalent flaws. Because of this issue, a process must wait a
longer period of time to be scheduled into the CPU. The hunger problem or the
starvation problem is the name given to this issue.
Round Robin CPU Scheduling:
Round Robin is a CPU scheduling mechanism those cycles around assigning
each task a specific time slot. It is the First come, First served CPU Scheduling
technique with preemptive mode. The Round Robin CPU algorithm frequently
emphasizes the Time-Sharing method.
One of the most used techniques for CPU core scheduling. Because the
processes are only allowed access to the CPU for a brief period of time, it is seen
as preemptive.
• To the end of the ready queue is added the newly formed process.
*****************************
DISTRIBUTED SYSTEM
While distributed operating systems offer many advantages, they also have
some disadvantages, including:
********************
SOFTWARE PROCESS MODELS
• Waterfall model
• V-Model
• RAD (Rapid Application Development) Model
• Spiral Model
• Incremental Model
Waterfall model
Winston Royce introduced the Waterfall Model in 1970. This model is named
"Waterfall Model", because its diagrammatic representation resembles a cascade of
waterfalls .
Advantage of V-Model:
Easy to Understand.
Testing Methods like planning, test designing happens well before coding.
This saves a lot of time. Hence a higher chance of success over the waterfall
model.
Disadvantage of V-Model:
Very rigid and least flexible.
Not a good for a complex project.
Software is developed during the implementation stage, so no early prototypes
of the software are produced
Spiral Model
Disadvantages
Can be a costly model to use.
Risk analysis needed highly particular expertise
Incremental Model
Requirement Engineering
The process to gather the software requirements from client, analysis and
document them is known as requirement engineering.
• Feasibility Study
• Requirement Gathering
• Software Requirement Specification
• Software Requirement Validation
Feasibility study
Requirement Gathering
*****************
1. Estimation Techniques
a. Top-Down Estimation
b. Bottom-Up Estimation
c. Analogous Estimation
d. Parametric Estimation
e. Expert Judgment
2. Scheduling Techniques
a. Gantt Charts
• Definition: A visual timeline that illustrates the start and end dates
of tasks in a project.
• Use: Provides a clear view of project progress, task dependencies,
and deadlines.
• Pros: Simple and easy to understand.
• Cons: May become complex for large projects.
e. Resource Leveling
3. Key Considerations