Skip to content

the second assignment is about Simulating the CPU Scheduling algorithms using Java.

Notifications You must be signed in to change notification settings

liliansteven/CPU-Scheduling-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Description of the Assignment : Write a java program to simulate the following schedulers

  • Before going into the following types of Scheduling, there are some sources will help you to understand more than what is in the assignment :
  1. jenny's playlist in Operating Systems
  2. CPU Scheduling | Chapter-5 | Operating System , Neso Academy's playlist
  3. Article : CPU Scheduling in Operating Systems

(1) preemptive Shortest- Job First (SJF) Scheduling with context switching.

alt text

Some sources that will help in understanding (SJF) Scheduling :

  1. All you need to know about Shortest Job First (SJF) Scheduling

  2. Shortest Remaining Time First (Preemptive SJF) Scheduling Algorithm

  3. Shortest Job First – Preemptive Scheduling with Example (SJF)

  • Videos
  1. SJF with processes having CPU and IO Time | CPU Scheduling Algorithm in OS

  2. Shortest Job First(SJF) Scheduling Algorithm with example | Operating System

  3. Scheduling Algorithms - Shortest Job First (SJF)

  4. Shortest Job First Scheduling (Solved Problem 1)

  5. Preemptive Shortest Job First (SRTF) - CPU Scheduling

(2) Round Robin (RR) with context switching.

alt text

Some sources that will help in understanding (RR) Scheduling :

  1. What is Round Robin Scheduling in OS?

  2. Program for Round Robin Scheduling for the same Arrival time

  3. Round Robin Scheduling with different arrival times

  4. Selfish Round Robin CPU Scheduling

  • Videos :
  1. Round Robin(RR) CPU Scheduling Algorithm in OS with example

  2. Round Robin(RR) Scheduling example with advantages and drawbacks | Operating Systems

  3. Round Robin (RR) Process Scheduling Algorithm with Example

  4. Scheduling Algorithms - Round Robin Scheduling

  5. Round Robin Scheduling (Turnaround Time & Waiting Time)

  6. Round Robin Scheduling - Solved Problem (Part 1)

  7. Round Robin Scheduling - Solved Problem (Part 2)

(3) preemptive Priority Scheduling (with the solving of starvation problem).

alt text

Some sources that will help in understanding Starvation and Aging problem && Priority Scheduling :

  1. Starvation and Aging in Operating Systems

  2. What Is Starvation In OS? Understand The Definition, Causes, Solution

  3. What is Starvation and Aging?

  4. Preemptive Priority CPU Scheduling Algorithm

  5. Priority Based CPU Scheduling Algorithm

  • Videos :
  1. Preemptive Priority Scheduling Algorithm in OS with example | Operating System

  2. Starvation and Aging in Priority Scheduling | Operating Systems

  3. Non Preemptive Priority Scheduling Algorithm with example | Operating System

(4) AG Scheduling :

  • Each process is provided a static time to execute called quantum.

  • Once a process is executed for given time period, it’s called FCFS till the finishing of (ceil(52%)) of its Quantum time then it’s converted tenon preemptive Priority till the finishing of the next(ceil(52%)), after that it’s converted to preemptive Shortest- Job First (SJF).

We have 3 scenarios of the running process in AG Scheduler :

  1. The running process used all its quantum time and it still have job to do (add this process to the end of the queue, then increases its Quantum time by Two .

  2. The running process was execute as non-preemptive Priority and didn’t use all its quantum time based on another process converted from ready to running (add this process to the end of the queue, and then increase its Quantum time by ceil(the remaining Quantum time/2) ).

  3. The running process was execute as preemptive Shortest- Job First (SJF) and didn’t use all its quantum time based on another process converted from ready to running (add this process to the end of the queue, and then increase its Quantum time by the remaining Quantum time).

  4. The running process didn’t use all of its quantum time because it’s no longer need that time and the job was completed (set it’s quantum time to zero).