By programming in C: Create a CPU scheduler that runs a round-robin algorithm. E
ID: 3701129 • Letter: B
Question
By programming in C:
Create a CPU scheduler that runs a round-robin algorithm. Each client sends the server an integer named burst (that represents a CPU burst) and the name of its private FIFO through the 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 time quantum named timeQuant. All processes arrive at the Ready Queue at time zero and are enqueued in the order they are submitted.
The server receives input from each of several clients. The server reads the input integer from a client, creates a node (a PCB) for the client, then enqueues the PCB 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, processing can begin. The process represented by the process at the head of Ready will “run” until the process completes or the time quantum expires. If the process completes, the client will be notified of the completion time and the process is removed from the system. If the time quantum expires, the node will be enqueued to Ready and the remaining time for burst is stored back into that node (its PCB). The clock can be manipulated by adding one to the clock to represent handling one CPU burst at a time.
A clock value (a counter) records the current time.
When a client’s burst is completed (equals 0), the value that is in clock is recorded, a turnaround time is calculated and both the clock value and the turnaround time are sent back to the client through its private FIFO. The server also reports when a client completes and the current clock time. When all clients have completed processing, the server reports the average turnaround time for the set of jobs.
Server Note:
commonFIFO is created and opened once.
When all clients have completed and results have been displayed, the server shuts down.
Client Note: The client program is one program that is run multiple times, thus, you will open multiple windows that run the client program.
Explanation / Answer
Given n processes with their burst times, the task is to find average waiting time and average turn around time using FCFS scheduling algorithm.
First in, first out (FIFO), also known as first come, first served (FCFS), is the simplest scheduling algorithm. FIFO simply queues processes in the order that they arrive in the ready queue.
In this, the process that comes first will be executed first and next process starts only after the previous gets fully executed.
Here we are considering that arrival time for all processes is 0.
How to compute below times in Round Robin using a program?
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.