Using the thread pool and providing an argument : ThreadPool : Thread C# Examples


C# Examples » Thread » ThreadPool »

 

Using the thread pool and providing an argument









    
using  System;
using  System.Threading;

class  MainClass
{
        public  static  void  DisplayMessage(object  state)
        {
                string  config  =  state  as  string;

                Console.WriteLine(config);

                Thread.Sleep(1000);
        }

        public  static  void  Main()
        {
                ThreadPool.QueueUserWorkItem(DisplayMessage,  "info");

        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Thread
» ThreadPool