Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPU SCHEDULING SIMULATION

Similar presentations


Presentation on theme: "CPU SCHEDULING SIMULATION"— Presentation transcript:

1 CPU SCHEDULING SIMULATION
Towson University – COS519 – Fall 2018 Members of Group #5:

2 Outlines: PURPOSE OF THE PROJECT INTRODUCTION TO CPU SCHEDULING
ATTRIBUTES OF THE PROCESS SCHEDULING ALGORITHMS IMPLEMENTATION SIMULATION OUTPUTS ANALYSIS OF ALGORITHMS CONCLUSION REFERENCES

3 Purpose of the Project:
To understand how CPU scheduling works in an Operating System. To analyze First In First Out, Shortest Job First and Round Robin Scheduling algorithms that determine the sequence of execution by CPU. To  compare the efficiency of each algorithm by measuring the Burst time, waiting time, and turn-around time.

4 Introduction to CPU Scheduling
CPU scheduling is a process which allows one process to use the CPU while the execution of another process is in waiting state due to unavailability of any resource like I/O etc, thereby making the maximum utilization of CPU.  Whenever the CPU becomes idle, it selects another process from the ready queue to run next. To select this process, scheduling algorithm are used. There are several algorithms to choose from, as well as numerous adjustable parameters for each algorithm. The algorithms implemented are: First In First Out Shortest Job First Round Robin

5 Attributes of Processes
Process ID: a unique value for each process. Wait Time: The duration of time the process waits to utilize CPU is called wait time. It can be calculated by the difference of turn-around time and burst time. Burst Time: The duration of time where the process gets to utilize the CPU is called burst time. Turn Around Time: The turn-around time the sum of waiting time of the process to get into the ready queue, execution on CPU and executing input/output. Arrival Time: It can be given as the time at which the process arrives in the ready queue.

6 scheduling algorithms used
First-Come, First-Served Allocating the CPU to the process that requests the CPU first. Using a FIFO queue  Average waiting time is more             Process  Burst Time                   P1     24                 P2     3                 P3       3  Average waiting time:  ( )/3 = 17 ms Average wait time of ( ) / 3 = 3.0 ms                                                                                                                          Fig. Gantt chart for process in the order p2,p3,p1

7 scheduling algorithms used
Shortest-Job-First Scheduling Depends on the length of the next CPU burst of a process. If the next CPU bursts of two processes are the same, FCFS scheduling is used. Two types: Pre-emptive, Non-pre-emptive. Preemptive SJF algorithm will preempt the currently executing process. Non-preemptive SJF algorithm will allow the currently running process to finish its CPU burst.  Non-pre-emptive: consider the following set of processes p1, p2, p3, p4 and their CPU burst given in milliseconds with arrival time as 0 for all the processes.                                 Process    Burst Time                                      P1                   6                                     P2                    8                                     P3                    7                                     P4                    3

8 scheduling algorithms used
Round-Robin Scheduling Round Robin is a preemptive scheduling algorithm.  A small unit of time, called a time quantum  CPU scheduler selects the process from the queue and allocates the CPU to each process for a time interval of one quantum. All the processes in the queue are executed in the cyclic way. Switching Overhead is the main problem.  Fig. Representation of the Round Robin Implementation

9 Implementation Technical Details: Data Structures: Language: Java
Platform: Linux (open source O/S)  Algorithms Used: FIFO, SJF, Round Robin Data Structures: Array – to keep the track of the processes as a queue                 – to keep the track of Burst Time of the processes   – to keep the track of Arrival Time of the processes

10 CPU scheduling Simulator Output:
FIFO Algorithm Result Set

11 CPU scheduling Simulator Output:
SJF Algorithm Result Set

12 CPU scheduling Simulator Output:
RR Algorithm Result Set

13 Analysis of First In First Out (FIFO)
For different burst times, the wait time have variations between the same range     (0 –1600) Wait time is dependent of arrival time, as it increases linearly when the arrival time increment too

14 Analysis of Shortest Job First (SJF)
No correlation between the arrival time and the process waiting time as expected Wait time increase as it does the burst time.

15 Analysis of Round Robin (RR)
For different burst times, the wait time have variations between the same range     (0 –1600) Wait time is dependent of arrival time, as it increases linearly when the arrival time increment too

16 Analysis summary of the 3 algorithms
Variation of the average wait time  as the number of processes completed increase for each  algorithm.

17 Conclusion FIFO - SJF – RR
FIFO : Convey Effect – short process behind long process SJF : Starvation  RR : Overhead             FIFO

18 REFERENCES Research papers: Books: Websites:
Kishor, L., & Goyal, D. (2013). Comparative analysis of various scheduling algorithms. International Journal of Advanced Research in Computer Engineering & Technology (IJARCET), 2(4), pp-1488.  Abhijit A. Rajguru, S. A. (July 2013). A Performance Analysis of Task Scheduling Algorithms using Qualitative Parameters. International Journal of Computer Applications,    Books:  Silberschatz, A., Galvin, P., and Gagne, G., "Operating System Concepts," (Sixth Edition), Wiley & Sons, 2002.    Websites: 

19 Thank You !


Download ppt "CPU SCHEDULING SIMULATION"

Similar presentations


Ads by Google