static void Main(string[] args) { string dataset = "1_BaseDataSet"; Dispatcher fcfs = new Fcfs(); Dispatcher rr = new Roundrobin(); Dispatcher spn = new Spn(); Dispatcher mlf = new MultiLevelFeedback(); Dispatcher ls = new LoadSharing(); CPU FCFS = new CPU(fcfs); CPU RR = new CPU(rr); CPU SPN = new CPU(spn); CPU MLF = new CPU(mlf); CPU LS = new CPU(ls); FCFS.runAlg(dataset); RR.runAlg(dataset); SPN.runAlg(dataset); MLF.runAlg(dataset); LS.runAlg(dataset); //TODO: Uncomment /* * collectData("\\2_LowIOProbability"); * collectData("\\3_HighIOProbability"); * * collectData("\\4_ShortJobs"); * collectData("\\5_LongJobs"); */ }
public static void collectData(string dataset) { Dispatcher fcfs = new Fcfs(); Dispatcher rr = new Roundrobin(); Dispatcher mlf = new MultiLevelFeedback(); Dispatcher ls = new LoadSharing(); Dispatcher spn = new Spn(); CPU FCFS = new CPU(fcfs); CPU RR = new CPU(rr); CPU MLF = new CPU(mlf); CPU LS = new CPU(ls); CPU SPN = new CPU(spn); List <Thread> threads = new List <Thread>(); threads.Add(new Thread(delegate() { FCFS.runAlg(dataset); })); threads.Add(new Thread(delegate() { RR.runAlg(dataset); })); threads.Add(new Thread(delegate() { MLF.runAlg(dataset); })); threads.Add(new Thread(delegate() { LS.runAlg(dataset); })); threads.Add(new Thread(delegate() { SPN.runAlg(dataset); })); foreach (Thread currthread in threads) { currthread.Start(); } }