Use the system thread pool : ThreadPool : Thread C# Examples


C# Examples » Thread » ThreadPool »

 

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);
    }
}
    
   
  
   



Output

1000 999 998 997 996 995 994 993 992 991 990 989 988


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Thread
» ThreadPool