Inheritance: IScheduler
示例#1
0
        private static void RunLotsOfProcesses()
        {
            var scheduler = new Scheduler();

            scheduler.Spawn(new SpawnLots());
            scheduler.Schedule();
        }
示例#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()));
        }
示例#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();
        }