9 cm402.18

467 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
467
On SlideShare
0
From Embeds
0
Number of Embeds
40
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

9 cm402.18

  1. 1. Understand process management• CPU Scheduling Algorithms, FCFS 1
  2. 2. HOME PREVIOUS TOPICNEXTPREVIOUS QUESTION PAPERSFOR OSCPP TUTORIALS 2
  3. 3. RecapIn last class, you have learnt• CPU scheduling• Scheduling criteria – CPU utilization – Through put – Turn around time – Waiting time – Response time 3
  4. 4. ObjectivesOn completion of this class, you would be able to know• Types of scheduling algorithms• FCFS scheduling algorithm 4
  5. 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. 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 islinked onto the tail of the queue 6
  7. 7. FCFS Consider an example of processes P1, P2, P3 arriving attime 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 P30 24 27 30 7
  8. 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. 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. 10. 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
  11. 11. SummaryIn this class, you have learnt• Types of scheduling algorithms• FCFS algorithm• Disadvantages of FCFS algorithm 12
  12. 12. Frequently Asked Questions1. List the types of CPU scheduling algorithm2. Explain FCFS algorithm3. Write the disadvantages of FCFS algorithm 13
  13. 13. Quiz1. FCFS algorithm is implemented by _________a) Job queueb) FIFO queuec) Ready queued) None 14
  14. 14. Quiz2. When the process enters into ready queue PCB is linked in to __________ of queuea) Headb) Tailc) None 15
  15. 15. Quiz3. Average waiting time on FCFS algorithm is ________a) Longb) Shortc) None 16
  16. 16. Quiz4. FCFS algorithm is ______________a) Preemptiveb) Non preemptivec) None 17
  17. 17. Other subject materials• Web designing• Micro processors• C++ tutorials• javahome

×