Inheritance: IScheduler
Ejemplo n.º 1
0
        private static void RunLotsOfProcesses()
        {
            var scheduler = new Scheduler();

            scheduler.Spawn(new SpawnLots());
            scheduler.Schedule();
        }
Ejemplo n.º 2
0
        private static void RunMergeSort()
        {
            var scheduler = new Scheduler();

            var mergeSort = new MergeSort(new[] { 3, 4, 3, 2, 7, 5, 9, 0 });
            scheduler.Spawn(mergeSort);
            scheduler.Schedule();

            Console.WriteLine(String.Join(", ", mergeSort.Results.Select(i => i.ToString()).ToArray()));
        }
Ejemplo n.º 3
0
        private static void RunPingPong()
        {
            var scheduler = new Scheduler();

            var ping = new PingPong("ping");
            var pong = new PingPong("pong");

            ping.Friend = pong;
            pong.Friend = ping;

            scheduler.Spawn(ping, pong);
            scheduler.Schedule();
        }