public static void Main()
    {
//        ThreadPoolDemo.Go();
//        ExecutionContexts.Go();
//        CancellationDemo.Go();
        TaskDemo.Go();
//        ParallelDemo.Go();
//        ParallelLinq.Go();
//        TimerDemo.Go();
//        FalseSharing.Go();
    }
示例#2
0
 public static void Main()
 {
     ThreadPoolDemo.Go();
     ExecutionContexts.Go();
     CancellationDemo.Go();
     TaskDemo.Go();
     ParallelDemo.Go();
     ParallelLinq.Go();
     TimerDemo.Go();
     FalseSharing.Go();
 }
示例#3
0
        public static void Main(String[] args)
        {
            TaskDemo   t  = new TaskDemo("Mallikarjuna");
            Func <int> a  = t.Count;
            Func <int> b  = t.Vowel;
            Task <int> p1 = new Task <int>(a);
            Task <int> p2 = new Task <int>(b);

            p1.Start();
            p2.Start();
            var p = Thread.CurrentThread.ManagedThreadId;

            Console.WriteLine($"Vowels Id-{p}");
            Console.WriteLine(p1.Result);
            Console.WriteLine(p2.Result);
        }
示例#4
0
 public void Setup()
 {
     _myDemo = new TaskDemo();
 }