Process scheduling
• It is an activity of the process manager that handles the
removal of the running process from the CPU and the selection
of another process on the basis of the particular strategy.
• Essential part of multiprogramming OS.
Non-preemptive preemptive
Preemptive:-
• It may be used when a process switches from a running state
or waiting state to a ready state.
• When a high priority process comes in the ready queue it
doesn’t have to wait for the running process to finish its burst
time.
• However , the running process is interrupted in the middle of
its execution and placed in the ready queue until the high
priority process uses the resources.
• Non-Preemptive:-
• It is a method that maybe used when a process
terminates or switches from the running to
waiting state.
• When processor are assigned to a process, that
keep the process until it eliminated or reaches a
waiting state.
• when the processor starts the process
execution, it must complete it before executing
the other process.
• It may not be interrupted in the middle.
• The scheduling is strict because the execution
process is not even preempted for a higher
priority process.
Scheduling Algorithm in OS :-
• These are various algorithm which are used by
the OS to schedule the processes on the
processor in an effective way.
Purpose:-
1.Maximum CPU utilization.
2.Fare allocation.
3.Maximum throughput.
4.Minimum turn around time.
5.Minimum waiting time.
6.Minimum response time.
Burst time:-
• Also referred as execution time.
• It is amount of CPU time the process requires
to complete its execution.
Completion Time:-
• It is when a process finishes execution and is
no longer being processed CPU.
TAT:-
• The time elapsed between the arrival of a
process and its completion.
TAT = CT - AT
Writing Time:-
• This is aprocess duration in the ready queue
before it begins executing.
WT = TAT - BT
Response Time:-
• It is the duration between the arrival of the
process and the first time it runs.
Response time = Time it started executing
– arrival time
FCFS:-
• Simplest and most straight forward scheduling
algorithm.
• Processes are executed in the order they arrive
in the ready queue.
• Non-preemptive:- once a process starts
executing, it cannot be interrupted until it
finishes
Advantages:-
Simplicity - easy to understand and implement.
Fairness – ensures that each process gets fair
share of CPU as its arrival time.
Disadvantages:-
Convoy effect :-
• A long process can delay all other processes.
• When a long process occupies the CPU, all
shorter processes have to wait until it finishes
its execution.
High Average waiting time :-
• Process with short executing time may have
long waiting time.
• Not suitable for interactive processes.
• Not suitable for time sharing system.