Sponsored Content
Full Discussion: Round Robin Algorithm
Top Forums UNIX for Dummies Questions & Answers Round Robin Algorithm Post 302589020 by Anne_Stark on Tuesday 10th of January 2012 01:15:19 PM
Old 01-10-2012
Round Robin Algorithm

Hey, guys

I have a task:

JobRunning timePriority
A103
B65
C22
D41
E84


All 5 jobs have the same arrival time.

The question is, what is the average waiting time according to Round Robin algorithm. Quantum = 1 min.

The answer that was given by a teacher:
(B+E+A+C+D)+(B+E+A+C)+ (B+E+A)+ (B+E+A)+ (B+E+A)+ (B+E+A)+ (E+A)+ (E+A)+ (A+A)/5 = 5.4

According to all information that I have read, waiting time for this question is 15.2. Where from the number 5.4 came from? Is this the real answer?

This is a question from my exam and its really bugging me. Smilie

Sorry for possible dumb question. I was reading questions in homework help section and was really embarrassing to ask this simple thing there.

Thanks
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Round Robin Scheduling

Hi, first post. Well, here goes: Ok, so I need to build a round robin scheduling algorithm. I understand HOW the algorithm works and I can write it down/show you on paper if you were to ask me "how does the RR scheduling algorithm work?" Only problem is that I'm having a hell of a time... (0 Replies)
Discussion started by: ramoneguru
0 Replies

2. UNIX for Dummies Questions & Answers

how to round a value

Hello, In a unix shell script,i want to round a variabele to a nearest number Ex: set count=104.4 How can i round that to 105.? Thanks, Sateesh (2 Replies)
Discussion started by: kotasateesh
2 Replies

3. Shell Programming and Scripting

writing files to a dir in round robin order

I have a list of directories. (say a1,a2,a3,a4,a5) I need to get the directory last modified and access the next one to put some files over there (say if a3 is the latest dir modified ie, last time files were put into a3, this time I need to move the files in a4)...and if a5 is the last modified... (6 Replies)
Discussion started by: kanchan_cp
6 Replies

4. Shell Programming and Scripting

Round the column value :

Hi .... Iam having the file ....in which 3rd column is numerical having 8 decimal part... i want that to cut to 2 decimal part ... Source File : E100|0|19940.10104030|0|1ABC E103|1|19942.10195849|3|0ABC E100|0|19943.10284858|0|1ABC I want to be ...... Reulst: ... (4 Replies)
Discussion started by: satyam_sat
4 Replies

5. Shell Programming and Scripting

Round with awk

Hi, I have a problem. Basically I dont know how to use awk. I have a script (below) which works fine. What I want to do is somehow "pipe" in the input say 4.5 and have it give the anwer, I dont want ot have to type it in, since it will be running in a script. Any ideas how to do this???? ... (1 Reply)
Discussion started by: AnnaLynn
1 Replies

6. Shell Programming and Scripting

Round Robin Distribution of Contents of file to 3 files

Hi I need to create a script that distributes in round robin fashion the contents of a file to 3 files. The number of lines in a content of file can vary from 1-n(Each line is just a one letter word).The entire lines needs to get distributed into 3 files ( The order doesnt matter) , at... (5 Replies)
Discussion started by: police
5 Replies

7. Shell Programming and Scripting

Round off the a Decimal value.

HI, I have a script which is used to calculate the Memory & CPU utilization a server. memx=`ssh -l siebel1 ${f} /usr/sbin/prtconf|grep -i 'Memory size'|tr -s " "|/usr/xpg4/bin/awk -F" " '{print $3 * 1024}'` v5=`ssh -l siebel1 ${f} vmstat 1 2 | tail -1 | tr -s " " | /usr/xpg4/bin/awk -v... (3 Replies)
Discussion started by: dear_abhi2007
3 Replies

8. Shell Programming and Scripting

Round up the decimals

Hi All, I would like to do the following in the shell script 561.76 to 562 I tried using this echo 'scale=0; 749 * 75 /100 ' | bc but just returned only 561 Please help me . I appreciate your help Thanks rajeevm (13 Replies)
Discussion started by: rajeevm
13 Replies

9. Programming

Round Robin Scheduling via UCONTEXT.H

Hi I am implementing Round Robin Scheduling using ucontext.h functions. Well i am using my own logic for round robin but i am stuck at one point. I am using swapcontext for shifting from one process to another. Now how do i get to know that after 4 sec(Round Robin Time) where the process has... (1 Reply)
Discussion started by: aditya08
1 Replies
TC(8)								       Linux								     TC(8)

NAME
drr - deficit round robin scheduler SYNOPSIS
tc qdisc ... add drr [ quantum bytes ] DESCRIPTION
The Deficit Round Robin Scheduler is a classful queuing discipline as a more flexible replacement for Stochastic Fairness Queuing. Unlike SFQ, there are no built-in queues -- you need to add classes and then set up filters to classify packets accordingly. This can be useful e.g. for using RED qdiscs with different settings for particular traffic. There is no default class -- if a packet cannot be classi- fied, it is dropped. ALGORITHM
Each class is assigned a deficit counter, initialized to quantum. DRR maintains an (internal) ''active'' list of classes whose qdiscs are non-empty. This list is used for dequeuing. A packet is dequeued from the class at the head of the list if the packet size is smaller or equal to the deficit counter. If the counter is too small, it is increased by quantum and the scheduler moves on to the next class in the active list. PARAMETERS
quantum Amount of bytes a flow is allowed to dequeue before the scheduler moves to the next class. Defaults to the MTU of the interface. The minimum value is 1. EXAMPLE &; USAGE To attach to device eth0, using the interface MTU as its quantum: # tc qdisc add dev eth0 handle 1 root drr Adding two classes: # tc class add dev eth0 parent 1: classid 1:1 drr # tc class add dev eth0 parent 1: classid 1:2 drr You also need to add at least one filter to classify packets. # tc filter add dev eth0 protocol .. classid 1:1 Like SFQ, DRR is only useful when it owns the queue -- it is a pure scheduler and does not delay packets. Attaching non-work-conserving qdiscs like tbf to it does not make sense -- other qdiscs in the active list will also become inactive until the dequeue operation suc- ceeds. Embed DRR within another qdisc like HTB or HFSC to ensure it owns the queue. You can mimic SFQ behavior by assigning packets to the attached classes using the flow filter: tc qdisc add dev .. drr for i in .. 1024;do tc class add dev .. classid $handle:$(print %x $i) tc qdisc add dev .. fifo limit 16 done tc filter add .. protocol ip .. $handle flow hash keys src,dst,proto,proto-src,proto-dst divisor 1024 perturb 10 SOURCE
o M. Shreedhar and George Varghese "Efficient Fair Queuing using Deficit Round Robin", Proc. SIGCOMM 95. NOTES
This implementation does not drop packets from the longest queue on overrun, as limits are handled by the individual child qdiscs. SEE ALSO
tc(8), tc-htb(8), tc-sfq(8) AUTHOR
sched_drr was written by Patrick McHardy. iproute2 January 2010 TC(8)
All times are GMT -4. The time now is 01:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy