Mega Code Archive

 
Categories / C# Tutorial / Thread
 

Use the system thread pool

using System; using System.Threading; class MainClass {   public static void Countdown(Object o)    {     for (int i = 1000; i > 0; i--)      {       Console.Write(i.ToString() + " ");     }   }   public static void Main()    {     ThreadPool.QueueUserWorkItem(new WaitCallback(Countdown), null);   } } 1000 999 998 997 996 995 994 993 992 991 990 989 988