Create Multiple Thread in C#

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using System.Threading.Tasks;  
  6. using System.Threading;  
  7. namespace MultipleThread  
  8. {  
  9.     class Program  
  10.     {  
  11.         static void Main(string[] args)  
  12.         {  
  13.             Thread thread = new Thread(DefferentThread);  
  14.             thread.Start();  
  15.             while (true)  
  16.             {  
  17.                 Console.WriteLine("This is MainThread");  
  18.             }  
  19.         }  
  20.         static void DefferentThread()  
  21.         {  
  22.             while (true)  
  23.             {  
  24.                 Console.WriteLine("This is DefferentThread");  
  25.             }  
  26.         }  
  27.     }  
  28. }  
Output:

This is DefferentThre
This is DefferentThre
This is DefferentThre
This is DefferentThre
This is DefferentThre
This is DefferentThre
This is MainThread
This is MainThread