Granville Barnett

Emulating Round Robin with CPUSS

One of the more used strategies in general irrespective of CPU scheduling is the round robin strategy that allows you to define some time quantum that each process will execute for unless within that time it voluntarily releases the CPU, if it doesn't finish within that time quantum then it gets put back into a queue.

Perhaps the hardest part of using the round robin, or certainly the most effective use is gained through appropriate selection of the time quantum. It tends to hold that the best time quantum to use is one that is greater than 80% of all CPU burst times.

Emulating a load scenario using the round robin strategy with CPUSS is dead easy.

    1 using Cpuss;

    2 using Cpuss.Strategies;

    3 

    4 namespace PerfApp

    5 {

    6     class Program

    7     {

    8         static void Main()

    9         {

   10             Runner runner = new Runner(20, 30, 10, new RoundRobin(60));

   11             runner.Run();

   12         }

   13     }

   14 }

Easy. Obviously you will want to perform some analysis on the metrics gathered for each process and so on but I won't go into that here. Also disregard the time quantum I have used (60ns) it was just chosen for demonstration purposes.

Download CPUSS.

Comments

No Comments