1 / 13

CPU Scheduling Algorithms Simulation using Java

CPU Scheduling Algorithms Simulation using Java. Kaushal Sinha CSC 4320 Spring 2007. CPU Scheduling Algorithms Simulation using Java. Implemented the following Scheduling algorithms First Come First Serve (FCFS) Round Robin Shortest Job First Shortest Remaining Time.

Download Presentation

CPU Scheduling Algorithms Simulation using Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CPU Scheduling Algorithms Simulation using Java Kaushal Sinha CSC 4320 Spring 2007

  2. CPU Scheduling Algorithms Simulation using Java Implemented the following Scheduling algorithms • First Come First Serve (FCFS) • Round Robin • Shortest Job First • Shortest Remaining Time

  3. CPU Scheduling Algorithms Simulation using Java First Come First Serve (FCFS) 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.

  4. CPU Scheduling Algorithms Simulation using Java Round Robin (RR) • RR is designed specially for time-sharing systems. • It is similar to FCFS 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.

  5. CPU Scheduling Algorithms Simulation using Java Round Robin (RR) – Contd … • The implementation of RR is easily managed with a FIFO 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. 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.

  6. CPU Scheduling Algorithms Simulation using Java Shortest Job First (SJF) 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.

  7. CPU Scheduling Algorithms Simulation using Java Shortest Remaining Time (SRT) 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.

  8. CPU Scheduling Algorithms Simulation using Java Selection of JAVA as a programming tool • Rich GUI classes available (Swing, AWT) • Object Orientation capabilities • Convenient and powerful documentation capabilities • I like it

  9. CPU Scheduling Algorithms Simulation using Java

  10. CPU Scheduling Algorithms Simulation using Java

  11. CPU Scheduling Algorithms Simulation using Java

  12. CPU Scheduling Algorithms Simulation using Java Demonstration

  13. CPU Scheduling Algorithms Simulation using Java Questions

More Related