✅ Thread and Threading

i have asked this question on the #help-0 an here is the link https://discord.com/channels/143867839282020352/169726586931773440/1269020486952816671 according to conversation with @TeBeCo i
have changed the code to be like below by question is now
T1.join() will block the main thread till it resolves , and then the T2 will block the main thread and the T1 Thread till it resolves is that correct
c#
        static void Main(string[] args)
        {
            Console.WriteLine("Main Thread Start");

            Thread T1 = new Thread(ThreadOneMethod);

            T1.Start();

            T1.Join();

            Thread T2 = new Thread(ThreadTwoMethod);

            T2.Start();

            T2.Join();

            Console.WriteLine("Thread Two Ends");

            Console.WriteLine("Thread One Ends");

            Console.WriteLine("Main Thread Ends");

        }

        public static void ThreadOneMethod()
        {
            Console.WriteLine("Thread One Starts");
        }


        public static void ThreadTwoMethod()
        {
            Console.WriteLine("Thread Two Starts");

        }

        public static void ThreadThreeMethod()
        {
            Console.WriteLine("Thread Three Starts");
        }
Was this page helpful?