Question: I want the JAVA CODE PLEASE SO;VE FAST FOR THUMBS UP This is a sinulationof Round Robin(RR)CPU scheduling algorithmand the systemqueues: Given the following declarations:
I want the JAVA CODE
PLEASE SO;VE FAST FOR THUMBS UP

This is a sinulationof Round Robin(RR)CPU scheduling algorithmand the systemqueues: Given the following declarations: struct PCB int proc-id; int PC: int CPU-Bust; int R1 R2; }; // Program Counter(Instruction Pointer IP) // Two dummy Registers PCB ready Q[8]; PCB job Q[9]; PCB.10Q[17]; int joba.johas: int iogE..iaR: int nr: int regl. reg2; // Front & Rear pointers of job queue // Front & Rear pointers of the i'o queue // Number of processes in the ready queue The main function may look like: void main initialize; processor; ; } (A)In initialize function Create 8 processes in the readxQ Create 9 processes in the job The io Qis initially empty The job Qand io Qqueues, each has two poirdes to the Front & Rear, the processes are added to the Rear of the quale and removed from the Front You mayuse anydata structure you want in the queue implementation, but I suggest to use the idea of circular anray concept foriohQand inQ forthe readxQuse a normal array since processes are serviced sequentiallyusing RR scheduling algorithen. + + Set program courter PC to 100 in all processes. Give a mumber 1... 17 to process-id mumber. Set CPU-Burstservice time) to a vahie between 0-100using randomfunction RI & R2 are justdurmyregistes, set them to 0. (B) Inprocessor function + It must contain a repeat forever loop. Consider a quartumtime, Q=20units of time. Inside a do...while statement consider a switchstatementwith 10 options which starts with PC=100.200.1000. The process changes PC each time it executes one of the switch statement options (choices). In one of the switchchoices use a random function Let the process wait on the iQ for I/O on a certain vahie of the randomfunction. Inone of the switchchoices, do a service forore of the processes in the in Qand swap it into the ready Each time the process enters the de..while loop, the process CPU-time indeciemented byl, exceptif an I/O service is being done, that is, the process is waiting in the in When the process finishes execution, the process is moved or swapped out from the ready to the job initializing its PCB fields to new vabies and another process is brought(swapped in) from the job When a process needs I/O, it is moved to the io Qto be serviced. Change the contents of the registers as you likeusing a random function These registers mustbe saved and reloaded when needed. + (C)What is the output?? Some messages: 1. A message showing which process starts executionincase choice (100), showing the total CPU burst time 2. which process is swapped out to the jobQand to inquere, and which is swapped in the ready 3. Which process is being serviced in the in 4. Which process has finished execution and moved to the job showing its new PCB vables
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
