SlideShare ist ein Scribd-Unternehmen logo
1 von 28
( T E C H N I C A L P R E S E N TAT I O N S K I L L S )
CPU SCHEDULING
SHRI VAISHNAV VIDYAPEETH VISHWAVIDYALAYA
SHRI VAISHNAV INSTITUTE OF INFORMATION TECHNOLOGY
DEPARTMENT OF INFORMATION TECHNOLOGY
Submitted By:
Yashita Namdeo
CSE – B
18100BTIT03158
Submitted To:
Mrs. Sonam Mehta
WHAT IS CPU SCHEDULING?
• Operating System manages a collection of processes.
• If a system has more processes and one CPU or more
processes with fewer CPU’s has to divide CPU time
among different processes.
• This is called CPU Scheduling
PROCESS STATE DIAGRAM
PROCESS STATES
• New State : process is under creation
• Ready State : waiting for CPU for execution
• Running State : under execution
• Termination : execution is completed
• Waiting/Block : waits for certain resource
• Suspend Wait : process waits in Secondary Memory
• Suspend Ready : moves from ready state to Secondary
Memory
NEED OF SCHEDULING?
• CPU scheduling is a process which allows one process
to use the CPU while the execution of another process is
on hold(in waiting state) due to unavailability of any
resource like I/O etc, thereby making full use of CPU.
• The aim of CPU scheduling is to make the system
efficient, fast and fair.
NEED OF SCHEDULING
• Whenever the CPU becomes idle, the operating system
must select one of the processes in the ready queue to
be executed.
• The selection process is carried out by the short-term
scheduler (or CPU scheduler).
• The scheduler selects from among the processes in
memory that are ready to execute, and allocates the
CPU to one of them.
Continue
OVERVIEW
• Short term scheduler : selects a process from ready
queue among the ready processes to execute on the
CPU.
• Based on the Scheduling Algorithm employed on the
system.
• CPU switching from one process to another requires
saving the state of the current process and having the
latest state of the next process. This is known as
Context Switching
• Dispatcher : the STS just selects the process which can
be assigned to the processor. The actual job of Context
Switching is done by dispatcher.
• Dispatch Latency : Time taken by dispatcher to stop
one process and start another process.
SCHEDULING CRITERIA
• Arrival Time ( AT )
• Burst Time ( BT / ET )
• Turn Around Time ( TAT )
• Waiting Time ( WT )
• Response Time ( RT )
• Completion Time ( CT )
• Arrival Time : time the process has arrived in RS.
• Burst Time/ Execution Time : time required by process
for its execution.
• Completion Time : time when process is completed.
• Turn Around Time : CT – AT
• Waiting Time : TAT – ET
• Response Time : AT – first response by CPU
• Throughput : no. of process that complete execution
per unit time.
• CPU Utilization : keep CPU as busy as possible.
TYPES OF SCHEDULING METHODS
• Preemptive – OS can force ( preempt ) a process from
CPU at anytime.
• Nonpreemptive – once a process is allocated the CPU,
it does not leave unless:
i. It has to wait( for I/O request)
ii. It terminates
SCHEDULING ALGORITHMS
• First Come First Serve ( FCFS )
• Shortest Job First ( SJF )
• Priority
• Round Robin ( RR )
FIRST COME FIRST SERVE
• First Come, First Serve (FCFS), is the simplest
scheduling algorithm, FIFO simply queues processes in
the order that they arrive in the ready queue.
• Throughput can be low, since long processes can hold
the CPU.
• It is based on Queuing.
• No prioritization occurs, thus this system has trouble
meeting process deadlines.
• Convey Effect – short process behind long process.
MERITS AND DEMERITS
Merits
• Easy to understand and
easy to program.
• It is fair.
Demerites
• Does not perform well in
real systems.
• Ignores the service time
request and all criteria.
SHORTEST JOB FIRST
i. Non preemptive – once CPU given to the process it
cannot be preempted until completes its CPU burst.
ii. Preemptive – if a new process arrives with CPU burst
length less than remaining time of current executing
process, preempt. This scheme is known as the
Shortest – Remaining – Time – First (SRTF).
MERITS AND DEMERITS
Merits
• SJF is optimal – gives
minimum average waiting
time for a given set of
processes.
Demerits
• Need to have a good
heuristic to guess the
next CPU execution time.
• Short duration processes
will starve longer ones.
PRIORITY SCHEDULING
• The SJF algorithm is a special case of the general
priority scheduling algorithm.
• A priority number(integer) is associated with each
process.
• The CPU is allocated to the process with the highest
priority (smallest integer = highest priority)
• Starvation (Infinity blocking) : low priority process may
never execute.
• Aging : as time progresses increases the priority of the
process.
MERITS AND DEMERITS
Merits
• Simplicity
• Reasonable support for
priority.
• Suitable for applications
with varying time and
resource requirements.
Demerits
• Indefinite blocking or
starvation.
• A priority scheduling can
leave some low priority
waiting processes
indefinitely for CPU.
ROUND ROBIN
• Each process gets a small unit of CPU time ( time
quantum ), usually 10-100 milliseconds. After this time
has elapsed, the process is preempted and added to the
end of the ready queue.
MERITS AND DEMERITS
Merits
• Fair allocation of CPU
across jobs.
• Low average waiting time
when job lengths vary.
Demerits
• It is suitable for task with
varied burst time. But for
task with same time
makes trouble.
CPU Scheduling.pptx
CPU Scheduling.pptx

Weitere ähnliche Inhalte

Ähnlich wie CPU Scheduling.pptx

CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling AlgorithmsTayba Farooqui
 
L6 CPU Scheduling.pptx
L6 CPU Scheduling.pptxL6 CPU Scheduling.pptx
L6 CPU Scheduling.pptxSeniorGaming
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Shreya Kumar
 
ch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdfch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdfSonaliAjankar
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-schedulingNazir Ahmed
 
May14ProcessScheduling.ppt
May14ProcessScheduling.pptMay14ProcessScheduling.ppt
May14ProcessScheduling.pptansariparveen06
 
LM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processesLM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processesmanideepakc
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .nathansel1
 
scheduling Uni processor Long-term .ppt
scheduling  Uni processor Long-term .pptscheduling  Uni processor Long-term .ppt
scheduling Uni processor Long-term .pptSaba651353
 
programming .pptx
programming .pptxprogramming .pptx
programming .pptxSHUJEHASSAN
 
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptxCPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptxTSha7
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentationusmankiyani1
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptxDivyaKS18
 

Ähnlich wie CPU Scheduling.pptx (20)

CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
CPU Scheduling Part-I.pdf
CPU Scheduling Part-I.pdfCPU Scheduling Part-I.pdf
CPU Scheduling Part-I.pdf
 
L6 CPU Scheduling.pptx
L6 CPU Scheduling.pptxL6 CPU Scheduling.pptx
L6 CPU Scheduling.pptx
 
Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.Process scheduling in Light weight weight and Heavy weight processes.
Process scheduling in Light weight weight and Heavy weight processes.
 
ch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdfch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdf
 
Ch6 cpu scheduling
Ch6   cpu schedulingCh6   cpu scheduling
Ch6 cpu scheduling
 
Ch05 cpu-scheduling
Ch05 cpu-schedulingCh05 cpu-scheduling
Ch05 cpu-scheduling
 
May14ProcessScheduling.ppt
May14ProcessScheduling.pptMay14ProcessScheduling.ppt
May14ProcessScheduling.ppt
 
pscheduling.ppt
pscheduling.pptpscheduling.ppt
pscheduling.ppt
 
Lecture 7 cpu scheduling
Lecture 7   cpu schedulingLecture 7   cpu scheduling
Lecture 7 cpu scheduling
 
LM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processesLM10,11,12 - CPU SCHEDULING algorithms and its processes
LM10,11,12 - CPU SCHEDULING algorithms and its processes
 
In computing, scheduling is the action .
In computing, scheduling is the action .In computing, scheduling is the action .
In computing, scheduling is the action .
 
Operating system
Operating systemOperating system
Operating system
 
scheduling Uni processor Long-term .ppt
scheduling  Uni processor Long-term .pptscheduling  Uni processor Long-term .ppt
scheduling Uni processor Long-term .ppt
 
programming .pptx
programming .pptxprogramming .pptx
programming .pptx
 
Section05 scheduling
Section05 schedulingSection05 scheduling
Section05 scheduling
 
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptxCPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
CPU Scheduling Criteria CPU Scheduling Criteria (1).pptx
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
PROCESS.pptx
PROCESS.pptxPROCESS.pptx
PROCESS.pptx
 

Kürzlich hochgeladen

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 

Kürzlich hochgeladen (20)

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 

CPU Scheduling.pptx

  • 1. ( T E C H N I C A L P R E S E N TAT I O N S K I L L S ) CPU SCHEDULING
  • 2. SHRI VAISHNAV VIDYAPEETH VISHWAVIDYALAYA SHRI VAISHNAV INSTITUTE OF INFORMATION TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY Submitted By: Yashita Namdeo CSE – B 18100BTIT03158 Submitted To: Mrs. Sonam Mehta
  • 3. WHAT IS CPU SCHEDULING? • Operating System manages a collection of processes. • If a system has more processes and one CPU or more processes with fewer CPU’s has to divide CPU time among different processes. • This is called CPU Scheduling
  • 5. PROCESS STATES • New State : process is under creation • Ready State : waiting for CPU for execution • Running State : under execution • Termination : execution is completed • Waiting/Block : waits for certain resource • Suspend Wait : process waits in Secondary Memory • Suspend Ready : moves from ready state to Secondary Memory
  • 6. NEED OF SCHEDULING? • CPU scheduling is a process which allows one process to use the CPU while the execution of another process is on hold(in waiting state) due to unavailability of any resource like I/O etc, thereby making full use of CPU. • The aim of CPU scheduling is to make the system efficient, fast and fair.
  • 7. NEED OF SCHEDULING • Whenever the CPU becomes idle, the operating system must select one of the processes in the ready queue to be executed. • The selection process is carried out by the short-term scheduler (or CPU scheduler). • The scheduler selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. Continue
  • 8. OVERVIEW • Short term scheduler : selects a process from ready queue among the ready processes to execute on the CPU. • Based on the Scheduling Algorithm employed on the system.
  • 9. • CPU switching from one process to another requires saving the state of the current process and having the latest state of the next process. This is known as Context Switching
  • 10. • Dispatcher : the STS just selects the process which can be assigned to the processor. The actual job of Context Switching is done by dispatcher. • Dispatch Latency : Time taken by dispatcher to stop one process and start another process.
  • 11. SCHEDULING CRITERIA • Arrival Time ( AT ) • Burst Time ( BT / ET ) • Turn Around Time ( TAT ) • Waiting Time ( WT ) • Response Time ( RT ) • Completion Time ( CT )
  • 12. • Arrival Time : time the process has arrived in RS. • Burst Time/ Execution Time : time required by process for its execution. • Completion Time : time when process is completed. • Turn Around Time : CT – AT • Waiting Time : TAT – ET • Response Time : AT – first response by CPU • Throughput : no. of process that complete execution per unit time. • CPU Utilization : keep CPU as busy as possible.
  • 13. TYPES OF SCHEDULING METHODS • Preemptive – OS can force ( preempt ) a process from CPU at anytime. • Nonpreemptive – once a process is allocated the CPU, it does not leave unless: i. It has to wait( for I/O request) ii. It terminates
  • 14. SCHEDULING ALGORITHMS • First Come First Serve ( FCFS ) • Shortest Job First ( SJF ) • Priority • Round Robin ( RR )
  • 15. FIRST COME FIRST SERVE • First Come, First Serve (FCFS), is the simplest scheduling algorithm, FIFO simply queues processes in the order that they arrive in the ready queue. • Throughput can be low, since long processes can hold the CPU. • It is based on Queuing. • No prioritization occurs, thus this system has trouble meeting process deadlines. • Convey Effect – short process behind long process.
  • 16.
  • 17. MERITS AND DEMERITS Merits • Easy to understand and easy to program. • It is fair. Demerites • Does not perform well in real systems. • Ignores the service time request and all criteria.
  • 18. SHORTEST JOB FIRST i. Non preemptive – once CPU given to the process it cannot be preempted until completes its CPU burst. ii. Preemptive – if a new process arrives with CPU burst length less than remaining time of current executing process, preempt. This scheme is known as the Shortest – Remaining – Time – First (SRTF).
  • 19.
  • 20. MERITS AND DEMERITS Merits • SJF is optimal – gives minimum average waiting time for a given set of processes. Demerits • Need to have a good heuristic to guess the next CPU execution time. • Short duration processes will starve longer ones.
  • 21. PRIORITY SCHEDULING • The SJF algorithm is a special case of the general priority scheduling algorithm. • A priority number(integer) is associated with each process. • The CPU is allocated to the process with the highest priority (smallest integer = highest priority) • Starvation (Infinity blocking) : low priority process may never execute. • Aging : as time progresses increases the priority of the process.
  • 22.
  • 23. MERITS AND DEMERITS Merits • Simplicity • Reasonable support for priority. • Suitable for applications with varying time and resource requirements. Demerits • Indefinite blocking or starvation. • A priority scheduling can leave some low priority waiting processes indefinitely for CPU.
  • 24. ROUND ROBIN • Each process gets a small unit of CPU time ( time quantum ), usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue.
  • 25.
  • 26. MERITS AND DEMERITS Merits • Fair allocation of CPU across jobs. • Low average waiting time when job lengths vary. Demerits • It is suitable for task with varied burst time. But for task with same time makes trouble.