Question: Please write a pseudocode for the task below: Client and Server Preface Create a short-term scheduler that runs a round-robin CPU scheduler. Each client sends
Please write a pseudocode for the task below: Client and Server Preface
Create a short-term scheduler that runs a round-robin CPU scheduler. Each client sends the server an integer named burst (that represents a CPU burst request) and the name of its private FIFO through a common FIFO, named commonFIFO. The common FIFO is made only one time, and will be opened for reading only one time before processing any client data. The server is asked for a number of clients and an integer input named timeQuant.
The server receives input from each of several clients. The server reads the input integer from a client, creates a node for the client, then enqueues it to a queue named Ready. This is done for each client. Display the contents of the queue periodically. After all client information has been read and stored in the nodes of the queue, the value of timeQuant is subtracted from the value of burst in the node at the head of the queue (unless the current value of this nodes burst is less than timeQuant, in which case the value of the burst is subtracted) and the remaining time for burst is stored back in the node. The node at the front of the Ready Queue is dequeued from the head of the queue when a running process has either completed its burst, or it has completed the time quantum. If the running process has completed the time quantum, but has not completed its CPU burst, its node is enqueued at the tail of the Ready Queue.
A clock value records the total of all bursts. When a clients burst is completed (equals 0), the value that is in clock is recorded and sent back to the client through its private FIFO. The server will track the progress of each clients work by printing the value of the clock and how much time is left in the current clients burst. When all clients have completed processing, the server reports the average turnaround time for the set of jobs.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
