0% found this document useful (0 votes)
284 views1 page

Round Robin Scheduling

The document describes the algorithm for implementing Round Robin scheduling in a C program. The algorithm accepts the number of processes and time quantum as input. It then calculates the number of time slices for each process based on its burst time and the time quantum. It determines the waiting time and turnaround time for each process and finally calculates the average waiting time and average turnaround time.

Uploaded by

bharathimanian
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
284 views1 page

Round Robin Scheduling

The document describes the algorithm for implementing Round Robin scheduling in a C program. The algorithm accepts the number of processes and time quantum as input. It then calculates the number of time slices for each process based on its burst time and the time quantum. It determines the waiting time and turnaround time for each process and finally calculates the average waiting time and average turnaround time.

Uploaded by

bharathimanian
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

ROUND ROBIN SCHEDULING Aim: Write a C program to implement the various process scheduling mechanisms such

as Round Robin Scheduling.

Algorithm for RR
Step 1: Start the process Step 2: Accept the number of processes in the ready Queue and time quantum or time slice Step 3: For each process in the ready Q, assign the process id and accept the CPU burst time Step 4: Calculate the no. of time slices for each process where No. of time slice for process(n) = burst time process(n)/time slice Step 5: If the burst time is less than the time slice then the no. of time slices =1. Step 6: Consider the ready queue is a circular Q, calculate (a) Waiting time for process(n) = waiting time of process(n-1)+ burst time of process(n1) + the time difference in getting the CPU from process(n-1) (b) Turn around time for process(n) = waiting time of process(n) + burst time of process(n)+ the time difference in getting CPU from process(n). Step 7: Calculate (a) Average waiting time = Total waiting Time / Number of process (b) Average Turnaround time = Total Turnaround Time / Number of process Step 8: Stop the process

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy