Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Cpu scheduling algorithms simulation using java

5,600 views

Published on

Published in: Technology, News & Politics
  • Be the first to comment

  • Be the first to like this

Cpu scheduling algorithms simulation using java

  1. 1. CPU Scheduling Algorithms Simulation using Java <ul><li>Kaushal Sinha </li></ul><ul><li>CSC 4320 </li></ul><ul><li>Spring 2007 </li></ul>
  2. 2. CPU Scheduling Algorithms Simulation using Java <ul><li>Implemented the following Scheduling algorithms </li></ul><ul><li>First Come First Serve (FCFS) </li></ul><ul><li>Round Robin </li></ul><ul><li>Shortest Job First </li></ul><ul><li>Shortest Remaining Time </li></ul>
  3. 3. CPU Scheduling Algorithms Simulation using Java <ul><li>First Come First Serve (FCFS) </li></ul><ul><li>This non-preemptive scheduling algorithm follows the first-in, first-out (FIFO) 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. </li></ul>
  4. 4. CPU Scheduling Algorithms Simulation using Java <ul><li>Round Robin (RR) </li></ul><ul><li>RR is designed specially for time-sharing systems. </li></ul><ul><li>It is similar to FCFS but preemption is added to switch between processes. </li></ul><ul><li>A small unit of time, called a time quantum or time slice, is defined. </li></ul><ul><li>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. </li></ul>
  5. 5. CPU Scheduling Algorithms Simulation using Java <ul><li>Round Robin (RR) – Contd … </li></ul><ul><li>The implementation of RR is easily managed with a FIFO ready queue. </li></ul><ul><li>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. Otherwise, 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. </li></ul>
  6. 6. CPU Scheduling Algorithms Simulation using Java <ul><li>Shortest Job First (SJF) </li></ul><ul><li>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. </li></ul>
  7. 7. CPU Scheduling Algorithms Simulation using Java <ul><li>Shortest Remaining Time (SRT) </li></ul><ul><li>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. </li></ul>
  8. 8. CPU Scheduling Algorithms Simulation using Java <ul><li>Selection of JAVA as a programming tool </li></ul><ul><li>Rich GUI classes available (Swing, AWT) </li></ul><ul><li>Object Orientation capabilities </li></ul><ul><li>Convenient and powerful documentation capabilities </li></ul><ul><li>I like it </li></ul>
  9. 9. CPU Scheduling Algorithms Simulation using Java
  10. 10. CPU Scheduling Algorithms Simulation using Java
  11. 11. CPU Scheduling Algorithms Simulation using Java
  12. 12. CPU Scheduling Algorithms Simulation using Java <ul><li>Demonstration </li></ul>
  13. 13. CPU Scheduling Algorithms Simulation using Java Questions

×