0% found this document useful (0 votes)
534 views

CPU Scheduling Algorithms Simulation Using Java

This document discusses and compares four common scheduling algorithms: First Come First Serve, Round Robin, Shortest Job First, and Shortest Remaining Time. It also provides reasons for selecting Java as the programming language to implement these scheduling algorithms.

Uploaded by

Nilesh Ekka
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
534 views

CPU Scheduling Algorithms Simulation Using Java

This document discusses and compares four common scheduling algorithms: First Come First Serve, Round Robin, Shortest Job First, and Shortest Remaining Time. It also provides reasons for selecting Java as the programming language to implement these scheduling algorithms.

Uploaded by

Nilesh Ekka
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 13

| 

 

 
 


| 
 

 
 



Implemented the following


Scheduling algorithms

 irst Come irst Serve (CS)


 Round Robin
 Shortest Job irst
 Shortest Remaining Time
| 
 

 
 



   
 
This non-preemptive scheduling algorithm
follows the first-in, first-out (I ) policy.
As each process becomes ready, it joins the
ready queue. When the current running
process finishes execution, the oldest
process in the ready queue is selected to
run next.
| 
 

 
 



a a  aa

 RR is designed specially for time-sharing systems.


 It is similar to CS but preemption is added to
switch between processes.
 A small unit of time, called a time quantum or
time slice, is defined.
 The ready queue is treated as a circular queue.
The CPU scheduler goes around the ready queue,
allocating the CPU to each process for a time
interval of up to 1 time quantum.
| 
 

 
 



a a  aa  
 The implementation of RR is easily managed with a
I ready queue.
 The CPU is allocated to the process at the head the
ready queue. Then, one of two things will happen. If
the process has a CPU burst of less than 1 time
quantum, the process itself will release the CPU
voluntarily. The CPU is then assigned to the next
process in the ready queue. therwise, if the CPU
burst of the currently running job is longer than 1
time quantum, the process is preempted after 1
time quantum and put at the tail of the ready
queue. The CPU is then assigned to the next process
in the ready queue.
| 
 

 
 



  
This non-preemptive scheduling algorithm
favors processes with the shortest
expected process time. As each process
becomes ready, it joins the ready queue.
When the current running process finishes
execution, the process in the ready queue
with the shortest expected processing
time (or service time) is selected to run
next.
| 
 

 
 



a    a


This preemptive scheduling algorithm
favors processes with the shortest
remaining expected process time. As each
process becomes ready, it joins the ready
queue. This triggers an interrupt which
preempts the current running process
back into the ready queue. The process in
the ready queue with the shortest
remaining service time is selected to run
next.
| 
 

 
 



Selection of JAVA as a programming tool

 Rich GUI classes available (Swing, AWT)


 bject rientation capabilities
 Convenient and powerful documentation
capabilities
 I like it
| 
 

 
 


| 
 

 
 


| 
 

 
 


| 
 

 
 



emonstration
| 
 

 
 



-uestions

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy