Beispiel #1
0
 public void Initialize()
 {
     scheduler = Scheduler.getInstance();
     job1 = new Job((string[] args) => { foreach (string s in args) { Console.Out.WriteLine(s); } return ""; }, new Owner("owner1"), 2, 3);
     job2 = new Job((string[] args) => { foreach (string s in args) { Console.Out.WriteLine(s); } return ""; }, new Owner("owner2"), 2, 45);
     job3 = new Job((string[] args) => { foreach (string s in args) { Console.Out.WriteLine(s); } return ""; }, new Owner("owner3"), 2, 200);
 }
Beispiel #2
0
        public void setup()
        {
            BS = new BenchmarkSystem();
            sch = BS.scheduler;

            j1 = new Job(
                (string[] arg) =>
                {
                    foreach (string s in arg)
                    {
                        Console.Out.WriteLine(s);
                    }; return "";
                },
                new Owner("one"),
                1, // Cpus needed
                1000 // Runtime (in milliseconds)
                );

            delayedJob = new Job(
                (string[] arg) =>
                {
                    foreach (string s in arg)
                    {
                        Console.Out.WriteLine(s);
                    }; return "";
                },
                new Owner("delayed"),
                3, // Cpus needed
                1000 // Runtime (in milliseconds)
                );

            j3 = new Job(
                (string[] arg) =>
                {
                    foreach (string s in arg)
                    {
                        Console.Out.WriteLine(s);
                    }; return "";
                },
                new Owner("three"),
                1, // Cpus needed
                1000 // Runtime (in milliseconds)
                );

            j4 = new Job(
                (string[] arg) =>
                {
                    foreach (string s in arg)
                    {
                        Console.Out.WriteLine(s);
                    }; return "";
                },
                new Owner("four"),
                1, // Cpus needed
                1000 // Runtime (in milliseconds)
                );

            j5 = new Job(
                (string[] arg) =>
                {
                    foreach (string s in arg)
                    {
                        Console.Out.WriteLine(s);
                    }; return "";
                },
                new Owner("five"),
                1, // Cpus needed
                1000 // Runtime (in milliseconds)
                );

            // remove old jobs from the static scheduler
            while (!sch.Empty())
            {
                sch.popJob(10);
            }

            // add them again

            sch.addJob(j1);
            sch.addJob(delayedJob);
            sch.addJob(j3);
            sch.addJob(j4);
            sch.addJob(j5);
        }