Questions tagged [round-robin]

Process scheduling algorithm based on time slice.A time quanta is given to each process for its execution. as the time slice is expired,the other process is allowed to execute.

Round robin (RR) is one of the simplest scheduling algorithms for processes in an operating system. As the term is generally used, time slices are assigned to each process in equal portions and in circular order, handling all processes without priority (also known as cyclic executive). If a process hasn't finished by the end of the time slice, it is moved to the back of the queue so the next process in line can have its turn. Round-robin scheduling is simple, easy to implement, and starvation-free. Round-robin scheduling can also be applied to other scheduling problems, such as data packet scheduling in computer networks.

The name of the algorithm comes from the round-robin principle known from other fields, where each person takes an equal share of something in turn

312 questions
33
votes
4 answers

Python Weighted Random

I need to return different values based on a weighted round-robin such that 1 in 20 gets A, 1 in 20 gets B, and the rest go to C. So: A => 5% B => 5% C => 90% Here's a basic version that appears to work: import random x = random.randint(1,…
doremi
  • 14,921
  • 30
  • 93
  • 148
25
votes
4 answers

real time scheduling in Linux

This morning I read about Linux real time scheduling. As per the book 'Linux system programming by Robert Love', there are two main scheduling there. One is SCHED_FIFO, fifo and the second is SCHED_RR, the round robin. And I understood how a fifo…
theB
  • 2,048
  • 2
  • 20
  • 29
14
votes
3 answers

How to implement a round-robin circular list and count access requests of an element?

Scenario: For a list that have 3 elements: [A, B, C] You can circular access it as many times as you want. And there is an additional counting function records access count of each element. For example, if accessing it 7 times, should return: [A,…
Wuaner
  • 929
  • 2
  • 14
  • 31
10
votes
2 answers

priority based round robin algorithm in operating system: is this preempted?

in priority based round robin algorithm, when higher priority process (let's say P1) is arrived during lower priority process (P2) is processing, P2 must be preempted and P1 is processed instead. right? then what if, after specific time quantum (ex.…
HyunsooKim
  • 103
  • 1
  • 1
  • 5
9
votes
1 answer

Does a context switch occur in a system whose ready queue has only one process and which uses round-robin scheduling?

Does a context switch occur in a system whose ready queue has only one process and which uses round-robin scheduling? Assume that current cpu burst of the lone process spans more than one time-slice of the round-robin algorithm. My reasoning is as…
Abhijith Madhav
  • 2,748
  • 5
  • 33
  • 44
9
votes
8 answers

Round Robin Tournament algorithm in C#

I am having some trouble to achieve this little round robin project. What i try to do is to generate a preview calendar of games then I want to output; day 1: Team 1 vs Team 2; Team 3 vs Team 4; Team 5vs Team 6; day 2 Team 1 vs Team 4; Team 6 vs…
Polo
  • 1,770
  • 4
  • 18
  • 29
8
votes
1 answer

Large Time quantum vs small quantum for CPU Scheduling?

What are the main differences (and advantages/disadvantages) between using a large time quantum or a small time quantum in respect to round robin CPU scheduling?
Vimzy
  • 1,871
  • 8
  • 30
  • 56
7
votes
3 answers

Scheduling load with a round robin algorithm?

I need to write a round robin algorithm to schedule load to n endpoints? So if I have servers A, B and C I wanted to make sure to round-robin through them for each request I get. How do I do this in C#?
Nevin Mathai
  • 2,316
  • 13
  • 39
  • 54
7
votes
2 answers

Round-robin assignment

I have a Customers table and would like to assign a Salesperson to each customer in a round-robin fashion. Customers --CustomerID --FName --SalespersonID Salesperson --SalespersonID --FName So, if I have 15 customers and 5 salespeople,…
Sesame
  • 3,370
  • 18
  • 50
  • 75
7
votes
1 answer

Generic c# Round Robin (partitioned/sorted) Queue

I often have the need to process a queue of items where no one user should be able to block the queue and the items in the queue should be processed in some order. I frequently write a class to do this, but I thought there should be some generic…
powlette
  • 1,800
  • 20
  • 41
7
votes
2 answers

Time Slices in Round Robin Time Scheduling

If you have a very large (say too big) time slice for a round robin scheduler what kind of performance effect should I expect in the Operating System? My only thought is that processes that require a lot of time would benefit but most processes use…
Kairan
  • 5,342
  • 27
  • 65
  • 104
6
votes
4 answers

What is the best way to use collection as round robin in Mongodb

I have a collection named items with three documents. { _id: 1, item: "Pencil" } { _id: 1, item: "Pen" } { _id: 1, item: "Sharpner" } How could I query to get the document as round-robin? Consider I got multiple user requests at the…
john cena
  • 191
  • 1
  • 1
  • 7
6
votes
3 answers

Double round robin tournament

I am developing a sport torunament in Java based on round robin scheduling algorithm. For n teams I want to generate 2(n-1) rounds with n/2 matches. That is that every team must play a match in a round, and every 2 teams meet twice, once away and…
Alina Gabriela
  • 121
  • 1
  • 11
6
votes
1 answer

Tasks behaving incorrectly in round-robin schedule

I have FreeRTOS running on a STM32F4DISCOVERY board, and I have this code: xTaskCreate( vTask1, "Task 1", 200, NULL, 1, NULL ); xTaskCreate( vTask2, "Task 2", 200, NULL, 1, NULL ); vTaskStartScheduler(); where vTask1 is this function: void vTask1(…
0x5C91
  • 3,360
  • 3
  • 31
  • 46
6
votes
3 answers

LINQ order by "round robin"

Seems like this should be an easy task but I can't figure out how to do this with LINQ. The only information I've been able to find so far is regarding the round robin tournament format, which isn't what I'm after. I may be searching wrong. Given…
Eric
  • 186
  • 1
  • 10
1
2 3
20 21