Sunday, March 6, 2011

Round-Robin

"Round-robin" describes a method of choosing a resource for a task from a list of available ones, usually for the purposes of load balancing. Such may be distribution of incoming requests to a number of processors, worker threads or servers. As the basic algorithm, the scheduler selects a resource pointed to by a counter from a list, after which the counter is incremented and if the end is reached, returned to the beginning of the list. Round-robin selection has a positive characteristic of preventing starvation, as every resource will be eventually chosen by the scheduler, but may be unsuitable for some applications where affinity is desirable, for example when assigning a process to a CPU or in link aggregation.


I had to implement the same thing for an external call, we need to balance the load to a set of servers equally, so I had to create a CircularQueue (It's just a wrapper for a List)
All my items are located in an XML, and I just load them in an existing method, I only added a new block of code

No comments:

Post a Comment