Giter VIP home page Giter VIP logo

round-robin's Introduction

Round-Robin Scaling Algorithm Implementation

What is Scaling?

Scaling is a way to administrate all the processes in the CPU. It controlls the change between the execution of the processes.

Scheduling Criteria

  • Burst Time: Quantity of the duration needed for a process.
  • Turn Around Time: Interval that the process arrived and it was concluded.
  • Waiting Time: Time that the process is in the ready state.
  • Context Switching: store the state of a process so that it can be reloaded when required and execution can be resumed from the same point as earlier.
  • Average Turn Around Time: is the average turn around time of the algorithm.
  • Average Waiting Time: is the average waiting time of the algorithm.

What is Round-Robin?

Round-Robin is a scheduling algorithm that consists of dividing the CPU usage time (Central Processing Unit). Each process receives a time slice, this time is called Quantum. The processes are all stored in circular Queue (Buffer).

How can I run the code?

- First, you can download all the files, except by the .pdf;
- Then, you can compile the file RoundRobin.c;
- Next, you can rename the file saida.txt downloaded, see and compare the saida.txt generated with the other one;
- You can always modify the file dados.txt with your own data and the algorithm will generate the saida.txt;

The input

The format of the input follow the pattern:

0 8 2
1 5 3
3 1 4
6 4 1

The first column refers to the arrival time of each process, the second one the duration of each one and the last column rfers to the priority.

The output

An example of an output:

Quantum: 3

* * * * * * * * * *
*     Legenda     *
*                 *
*  ## : Execucao  *
*   -- : Espera   *
*                 *
* * * * * * * * * *

Tempo	 P1 	P2 	P3 	P4 	
0-1 	 ## 	   	   	   	
1-2 	 ## 	-- 	   	   	
2-3 	 ## 	-- 	   	   	
3-4 	 -- 	## 	-- 	   	
4-5 	 -- 	## 	-- 	   	
5-6 	 -- 	## 	-- 	   	
6-7 	 -- 	-- 	## 	-- 	
7-8 	 ## 	-- 	   	-- 	
8-9 	 ## 	-- 	   	-- 	
9-10 	 ## 	-- 	   	-- 	
10-11 	 -- 	-- 	   	## 	
11-12 	 -- 	-- 	   	## 	
12-13 	 -- 	-- 	   	## 	
13-14 	 -- 	## 	   	-- 	
14-15 	 -- 	## 	   	-- 	
15-16 	 ## 	   	   	-- 	
16-17 	 ## 	   	   	-- 	
17-18 	    	   	   	## 	

ID do processo 		 Tempo de Duracao 		 Tempo de Vida 		 Tempo de Espera  
Processo [1] 				 8 				 17 				 9
Processo [2] 				 5 				 14 				 9
Processo [3] 				 1 				 4 				 3
Processo [4] 				 4 				 12 				 8      

Tempo medio de vida:	11.75
Tempo medio de espera:	7.25

The first line refers to the Quantum used, then we have a legend of the execution diagram, the proper one and we also have a table with each process and their burst time, turn around time and waiting time. The average turn around time and average waiting time are on the bottom ("Tempo médio de vida" e "Tempo médio de espera").

Developers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.