Question: Assume you are developing an operating system that follows Round-Robin (RR) process scheduling algorithm. In the RR scheduling, processes are allocated to the CPU for
Assume you are developing an operating system that follows Round-Robin (RR) process scheduling algorithm. In the RR scheduling, processes are allocated to the CPU for execution as per their arrival sequence for a fixed period of time (also known as time quanta). If the process is not executed fully, it is taken off the CPU and sent to the end of the process queue for its next turn. Write a Java program in Java to implement the RR scheduling algorithm using a Singly Circular Linked List. Users can execute as many processes as they wish. Assume the initial arrival time of each process is the same. Your program will insert the processes in the process queue, allocate the processes one-by-one to the CPU for execution, and print appropriate messages depending on the situation. You can use relevant Java built-in classes in your code. Read the time quanta, the total number of processes, each processs name, and its execution time from the user. Print the current process queue along with each processs remaining execution time after each round of execution. The sample inputs/ outputs are given below: Sample inputs and outputs Enter the total number of processes: 3 Enter the time quanta: 100 Enter the name of process 1: P1 Enter its execution time: 200 Enter the name of process 1: P2 Enter its execution time: 90 Enter the name of process 1: P3 Enter its execution time: 350 The process queue: P1, 200 P2, 90 P3, 350 Execution phase: The process queue: P2, 90 P3, 350 P1, 100 The process queue: P3, 350 P1, 100 Process P2 is executed The process queue: P1, 100 P3, 250 The process queue: P3, 250 Process P1 is executed The process queue: P3, 150 The process queue: P3, 50 The process queue is empty Process P3 is executed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
