Пример #1
0
        static void Main(string[] args)
        {
            MatX matrix = new MatX();

            Task t_m_Y3 = new Task(matrix.m_Y3);
            Task t_m_b  = new Task(matrix.m_b);
            Task t_m_y1 = new Task(matrix.m_y1);
            Task t_m_y2 = new Task(matrix.m_y2);
            Task t_m_f  = new Task(matrix.f);
            Task t_m_s  = new Task(matrix.s);
            Task t_m_t  = new Task(matrix.t);
            Task t_m_x  = new Task(matrix.x);

            t_m_Y3.Start();
            t_m_b.Start();
            t_m_y1.Start();
            t_m_y2.Start();

            Task.WaitAny(t_m_Y3);
            Task.WaitAny(t_m_b);
            Task.WaitAny(t_m_y1);
            Task.WaitAny(t_m_y2);


            t_m_f.Start();
            t_m_s.Start();
            t_m_t.Start();

            Task.WaitAny(t_m_f);
            Task.WaitAny(t_m_s);
            Task.WaitAny(t_m_t);


            t_m_x.Start();



            Task.WaitAny(t_m_x);



            matrix.Output();

            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            MatX matrix = new MatX();

            Thread t_m_Y3 = new Thread(matrix.m_Y3);
            Thread t_m_b  = new Thread(matrix.m_b);
            Thread t_m_y1 = new Thread(matrix.m_y1);
            Thread t_m_y2 = new Thread(matrix.m_y2);
            Thread t_m_f  = new Thread(matrix.f);
            Thread t_m_s  = new Thread(matrix.s);
            Thread t_m_t  = new Thread(matrix.t);
            Thread t_m_x  = new Thread(matrix.x);

            t_m_Y3.Start();
            t_m_b.Start();
            t_m_y1.Start();
            t_m_y2.Start();

            t_m_Y3.Join();
            t_m_b.Join();
            t_m_y1.Join();
            t_m_y2.Join();

            t_m_f.Start();
            t_m_s.Start();
            t_m_t.Start();

            t_m_f.Join();
            t_m_s.Join();
            t_m_t.Join();

            t_m_x.Start();



            t_m_x.Join();


            matrix.Output();

            Console.ReadKey();
        }