System.Threading.Tasks - Task.Factory.

   Task a1 = Task.Factory.StartNew(() => t1()).ContinueWith(y=> t3());

            Task a2 = Task.Factory.StartNew(() => t2());


 
        static   void t1()
        {
            Console.WriteLine("t1 -basla- ");
            for (int i = 0i < 10i++)
            {
                Thread.Sleep(1000);
                Console.WriteLine("t1 -" + i.ToString() + "-");
            }

            Console.WriteLine("t1 son");
        }


        static void t2()
        {
            Console.WriteLine("t2 -basla- ");
            for (int i = 0i < 10i++)
            {
                Thread.Sleep(1000);
                Console.WriteLine("t2 -" + i.ToString() + "-");
            }

            Console.WriteLine("t2 son");
        }

        static void t3()
        {
            Console.WriteLine("t3 -basla- ");
            for (int i = 0i < 10i++)
            {
                Thread.Sleep(1000);
                Console.WriteLine("t3 -" + i.ToString() + "-");
            }

            Console.WriteLine("t3 son");
        }



Yorumlar