SlideShare uma empresa Scribd logo
1 de 18
Understand process management
• CPU Scheduling Algorithms, FCFS




                                    1
HOME     PREVIOUS TOPIC
NEXT
PREVIOUS QUESTION PAPERS
FOR OS
CPP TUTORIALS




                           2
Recap

In last class, you have learnt
• CPU scheduling

• Scheduling criteria
   – CPU utilization

   – Through put

   – Turn around time

   – Waiting time

   – Response time
                                 3
Objectives

On completion of this class, you would be able to know
• Types of scheduling algorithms

• FCFS scheduling algorithm




                                                    4
Scheduling algorithms

• The CPU scheduling, selects a process in the ready
  queue, for execution using scheduling algorithms
• Scheduling algorithm can be classified into
   – First come, first served scheduling
   – Shortest job first scheduling
   – Priority scheduling
   – Round robin scheduling
   – Multilevel queue scheduling
   – Multilevel feedback queue scheduling
                                                       5
FCFS Scheduling Algorithm

•It is the simplest scheduling algorithm

• A process that requests the CPU first is allocated first

   Hence the name First come, First serve

• It is implemented by First in First out (FIFO) Queue

• Whenever the process enters into the ready queue PCB is
linked onto the tail of the queue
                                                         6
FCFS
  Consider an example of processes P1, P2, P3 arriving at
time instant 0 and their CPU burst times are shown below:
     Process                Burst time (msecs)
      P1                       24
      P2                       3
      P3                      3
      The Gantt chart below shows the result

            P1                     P2         P3
0                             24         27        30
                                                        7
FCFS
• Average waiting time and average turn around time are
  calculated using the example in previous slide
   – Waiting time = stating time – arrival time
   – The waiting time for process P1
   – P1= 0 – 0 = 0msec
   – The waiting time for process P2
   – P2 = 24 – 0 = 24msec
   – The waiting time for process P3
   – P3 = 27 – 0 = 27msec

• Average waiting time=(0+24+27)/3=17msec
                                                    8
FCFS ( Disadvantages )
• Average turn around time=(24+27+30)=27msec

• The average waiting time measured under FCFS policy is long
    (i.e. 17 m sec)
• For example in previous slide if processes arrive in the order P2,
    P3, P1 it results in the following Gantt chart

      P2          P3                   P1
     0          3                     6                   30

•   The average waiting time is (6+0+3)/3=3msec


                                                               9
FCFS (Disadvantages)

• FCFS scheduling algorithm is Non preemptive
   – So, trouble some for time sharing system

• Each user gets a share of CPU at regular intervals
  in timesharing system
• It is disastrous to allow are process to keep the
  keep the CPU for an extended period


                                                       11
Summary

In this class, you have learnt
• Types of scheduling algorithms

• FCFS algorithm

• Disadvantages of FCFS algorithm




                                    12
Frequently Asked Questions

1. List the types of CPU scheduling algorithm

2. Explain FCFS algorithm

3. Write the disadvantages of FCFS algorithm




                                                13
Quiz

1. FCFS algorithm is implemented by _________
a) Job queue
b) FIFO queue
c) Ready queue
d) None




                                                14
Quiz

2. When the process enters into ready queue PCB is linked in
     to __________ of queue

a)   Head

b)   Tail

c)   None




                                                           15
Quiz

3. Average waiting time on FCFS algorithm is ________

a)   Long

b)   Short

c)   None




                                                        16
Quiz


4. FCFS algorithm is ______________
a) Preemptive
b) Non preemptive
c) None




                                      17
Other subject materials
•   Web designing
•   Micro processors
•   C++ tutorials
•   java

home

Mais conteúdo relacionado

Mais procurados

Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)Harshit Jain
 
RR and priority scheduling
RR and priority schedulingRR and priority scheduling
RR and priority schedulingA. S. M. Shafi
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithmssathish sak
 
first come first serve scheduling in os
first come first serve scheduling in os first come first serve scheduling in os
first come first serve scheduling in os mikeemukesh
 
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...David Evans
 
Operating system
Operating systemOperating system
Operating systemLovly Angel
 
Scheduling Algorithms-R.D.Sivakumar
Scheduling Algorithms-R.D.SivakumarScheduling Algorithms-R.D.Sivakumar
Scheduling Algorithms-R.D.SivakumarSivakumar R D .
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Nagarajan
 
Comparison of scheduling algorithms
Comparison of scheduling algorithmsComparison of scheduling algorithms
Comparison of scheduling algorithmslodhran-hayat
 
Operating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - SchedulingOperating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - SchedulingPeter Tröger
 

Mais procurados (20)

Sa by shekhar
Sa by shekharSa by shekhar
Sa by shekhar
 
scheduling algorithm
scheduling algorithmscheduling algorithm
scheduling algorithm
 
Scheduling algo(by HJ)
Scheduling algo(by HJ)Scheduling algo(by HJ)
Scheduling algo(by HJ)
 
OSCh6
OSCh6OSCh6
OSCh6
 
RR and priority scheduling
RR and priority schedulingRR and priority scheduling
RR and priority scheduling
 
Operating Systems Process Scheduling Algorithms
Operating Systems   Process Scheduling AlgorithmsOperating Systems   Process Scheduling Algorithms
Operating Systems Process Scheduling Algorithms
 
Os module 2 ba
Os module 2 baOs module 2 ba
Os module 2 ba
 
Process Scheduling
Process SchedulingProcess Scheduling
Process Scheduling
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
first come first serve scheduling in os
first come first serve scheduling in os first come first serve scheduling in os
first come first serve scheduling in os
 
Ch5
Ch5Ch5
Ch5
 
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
Smarter Scheduling (Priorities, Preemptive Priority Scheduling, Lottery and S...
 
Operating system
Operating systemOperating system
Operating system
 
Scheduling Algorithms-R.D.Sivakumar
Scheduling Algorithms-R.D.SivakumarScheduling Algorithms-R.D.Sivakumar
Scheduling Algorithms-R.D.Sivakumar
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)
 
Comparison of scheduling algorithms
Comparison of scheduling algorithmsComparison of scheduling algorithms
Comparison of scheduling algorithms
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
cpu scheduling.pdf
cpu scheduling.pdfcpu scheduling.pdf
cpu scheduling.pdf
 
Operating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - SchedulingOperating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - Scheduling
 

Destaque

Disk scheduling algorithms
Disk scheduling algorithms Disk scheduling algorithms
Disk scheduling algorithms Paresh Parmar
 
Kruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.comKruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.comHemant Gautam
 
Prim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmPrim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmAcad
 
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)Madhu Bala
 
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmA presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmGaurav Kolekar
 
Prims Algorithm
Prims AlgorithmPrims Algorithm
Prims AlgorithmSriram Raj
 
Kruskal & Prim's Algorithm
Kruskal & Prim's AlgorithmKruskal & Prim's Algorithm
Kruskal & Prim's AlgorithmIfad Rahman
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Mohanlal Sukhadia University (MLSU)
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra Sahil Kumar
 
Minimum Spanning Tree
Minimum Spanning TreeMinimum Spanning Tree
Minimum Spanning Treezhaokatherine
 
Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs schedulingmyrajendra
 
2.4 mst prim’s algorithm
2.4 mst  prim’s algorithm2.4 mst  prim’s algorithm
2.4 mst prim’s algorithmKrish_ver2
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treeoneous
 

Destaque (20)

Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Disk scheduling algorithms
Disk scheduling algorithms Disk scheduling algorithms
Disk scheduling algorithms
 
Kruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.comKruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.com
 
Prim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmPrim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithm
 
Greedy minimum spanning tree- prim's algorithm
Greedy minimum spanning tree- prim's algorithmGreedy minimum spanning tree- prim's algorithm
Greedy minimum spanning tree- prim's algorithm
 
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
 
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmA presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithm
 
Prims Algorithm
Prims AlgorithmPrims Algorithm
Prims Algorithm
 
Kruskal & Prim's Algorithm
Kruskal & Prim's AlgorithmKruskal & Prim's Algorithm
Kruskal & Prim's Algorithm
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
 
Prim algorithm
Prim algorithmPrim algorithm
Prim algorithm
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Minimum Spanning Tree
Minimum Spanning TreeMinimum Spanning Tree
Minimum Spanning Tree
 
Prim's algorithm
Prim's algorithmPrim's algorithm
Prim's algorithm
 
Kruskal Algorithm
Kruskal AlgorithmKruskal Algorithm
Kruskal Algorithm
 
Fcfs scheduling
Fcfs schedulingFcfs scheduling
Fcfs scheduling
 
2.4 mst prim’s algorithm
2.4 mst  prim’s algorithm2.4 mst  prim’s algorithm
2.4 mst prim’s algorithm
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning tree
 
Huffman
HuffmanHuffman
Huffman
 

Semelhante a 9 cm402.18

3 process scheduling
3 process scheduling3 process scheduling
3 process schedulingahad alam
 
fggggggggggggggggggggggggggggggfffffffffffffffffff
fggggggggggggggggggggggggggggggffffffffffffffffffffggggggggggggggggggggggggggggggfffffffffffffffffff
fggggggggggggggggggggggggggggggfffffffffffffffffffadugnanegero
 
Process Scheduling Algorithms for Operating Systems
Process Scheduling Algorithms for Operating SystemsProcess Scheduling Algorithms for Operating Systems
Process Scheduling Algorithms for Operating SystemsKathirvelRajan2
 
3_process_scheduling.ppt----------------
3_process_scheduling.ppt----------------3_process_scheduling.ppt----------------
3_process_scheduling.ppt----------------DivyaBorade3
 
Csc4320 chapter 5 2
Csc4320 chapter 5 2Csc4320 chapter 5 2
Csc4320 chapter 5 2pri534
 
dataprocess using different technology.ppt
dataprocess using different technology.pptdataprocess using different technology.ppt
dataprocess using different technology.pptssuserf6eb9b
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu schedulingpiku das
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdfKp Sharma
 
Operating system 29 non preemptive scheduling
Operating system 29 non preemptive schedulingOperating system 29 non preemptive scheduling
Operating system 29 non preemptive schedulingVaibhav Khanna
 
Operating Systems Third Unit - Fourth Semester - Engineering
Operating Systems Third Unit  - Fourth Semester - EngineeringOperating Systems Third Unit  - Fourth Semester - Engineering
Operating Systems Third Unit - Fourth Semester - EngineeringYogesh Santhan
 

Semelhante a 9 cm402.18 (20)

5 Process Scheduling
5 Process Scheduling5 Process Scheduling
5 Process Scheduling
 
CPU Scheduling Part-II.pdf
CPU Scheduling Part-II.pdfCPU Scheduling Part-II.pdf
CPU Scheduling Part-II.pdf
 
3 process scheduling
3 process scheduling3 process scheduling
3 process scheduling
 
fggggggggggggggggggggggggggggggfffffffffffffffffff
fggggggggggggggggggggggggggggggffffffffffffffffffffggggggggggggggggggggggggggggggfffffffffffffffffff
fggggggggggggggggggggggggggggggfffffffffffffffffff
 
3_process_scheduling.ppt
3_process_scheduling.ppt3_process_scheduling.ppt
3_process_scheduling.ppt
 
Process Scheduling Algorithms for Operating Systems
Process Scheduling Algorithms for Operating SystemsProcess Scheduling Algorithms for Operating Systems
Process Scheduling Algorithms for Operating Systems
 
3_process_scheduling.ppt----------------
3_process_scheduling.ppt----------------3_process_scheduling.ppt----------------
3_process_scheduling.ppt----------------
 
3_process_scheduling.ppt
3_process_scheduling.ppt3_process_scheduling.ppt
3_process_scheduling.ppt
 
20
20 20
20
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Os..
Os..Os..
Os..
 
Csc4320 chapter 5 2
Csc4320 chapter 5 2Csc4320 chapter 5 2
Csc4320 chapter 5 2
 
Ch5 answers
Ch5 answersCh5 answers
Ch5 answers
 
dataprocess using different technology.ppt
dataprocess using different technology.pptdataprocess using different technology.ppt
dataprocess using different technology.ppt
 
5 Sol
5 Sol5 Sol
5 Sol
 
Os2
Os2Os2
Os2
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
OS Process Chapter 3.pdf
OS Process Chapter 3.pdfOS Process Chapter 3.pdf
OS Process Chapter 3.pdf
 
Operating system 29 non preemptive scheduling
Operating system 29 non preemptive schedulingOperating system 29 non preemptive scheduling
Operating system 29 non preemptive scheduling
 
Operating Systems Third Unit - Fourth Semester - Engineering
Operating Systems Third Unit  - Fourth Semester - EngineeringOperating Systems Third Unit  - Fourth Semester - Engineering
Operating Systems Third Unit - Fourth Semester - Engineering
 

Mais de myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

9 cm402.18

  • 1. Understand process management • CPU Scheduling Algorithms, FCFS 1
  • 2. HOME PREVIOUS TOPIC NEXT PREVIOUS QUESTION PAPERS FOR OS CPP TUTORIALS 2
  • 3. Recap In last class, you have learnt • CPU scheduling • Scheduling criteria – CPU utilization – Through put – Turn around time – Waiting time – Response time 3
  • 4. Objectives On completion of this class, you would be able to know • Types of scheduling algorithms • FCFS scheduling algorithm 4
  • 5. Scheduling algorithms • The CPU scheduling, selects a process in the ready queue, for execution using scheduling algorithms • Scheduling algorithm can be classified into – First come, first served scheduling – Shortest job first scheduling – Priority scheduling – Round robin scheduling – Multilevel queue scheduling – Multilevel feedback queue scheduling 5
  • 6. FCFS Scheduling Algorithm •It is the simplest scheduling algorithm • A process that requests the CPU first is allocated first Hence the name First come, First serve • It is implemented by First in First out (FIFO) Queue • Whenever the process enters into the ready queue PCB is linked onto the tail of the queue 6
  • 7. FCFS Consider an example of processes P1, P2, P3 arriving at time instant 0 and their CPU burst times are shown below: Process Burst time (msecs) P1 24 P2 3 P3 3 The Gantt chart below shows the result P1 P2 P3 0 24 27 30 7
  • 8. FCFS • Average waiting time and average turn around time are calculated using the example in previous slide – Waiting time = stating time – arrival time – The waiting time for process P1 – P1= 0 – 0 = 0msec – The waiting time for process P2 – P2 = 24 – 0 = 24msec – The waiting time for process P3 – P3 = 27 – 0 = 27msec • Average waiting time=(0+24+27)/3=17msec 8
  • 9. FCFS ( Disadvantages ) • Average turn around time=(24+27+30)=27msec • The average waiting time measured under FCFS policy is long (i.e. 17 m sec) • For example in previous slide if processes arrive in the order P2, P3, P1 it results in the following Gantt chart P2 P3 P1 0 3 6 30 • The average waiting time is (6+0+3)/3=3msec 9
  • 10.
  • 11. FCFS (Disadvantages) • FCFS scheduling algorithm is Non preemptive – So, trouble some for time sharing system • Each user gets a share of CPU at regular intervals in timesharing system • It is disastrous to allow are process to keep the keep the CPU for an extended period 11
  • 12. Summary In this class, you have learnt • Types of scheduling algorithms • FCFS algorithm • Disadvantages of FCFS algorithm 12
  • 13. Frequently Asked Questions 1. List the types of CPU scheduling algorithm 2. Explain FCFS algorithm 3. Write the disadvantages of FCFS algorithm 13
  • 14. Quiz 1. FCFS algorithm is implemented by _________ a) Job queue b) FIFO queue c) Ready queue d) None 14
  • 15. Quiz 2. When the process enters into ready queue PCB is linked in to __________ of queue a) Head b) Tail c) None 15
  • 16. Quiz 3. Average waiting time on FCFS algorithm is ________ a) Long b) Short c) None 16
  • 17. Quiz 4. FCFS algorithm is ______________ a) Preemptive b) Non preemptive c) None 17
  • 18. Other subject materials • Web designing • Micro processors • C++ tutorials • java home