using System;
using System.Threading;
using System.Collections.Generic;
using System.Text;

namespace ThreadPoolDemo
{
   class Program
   {
      static void Main(string[] args)
      {
         for (int i = 0; i < 20; i++)
         {
            ThreadPool.QueueUserWorkItem(new WaitCallback(DoWork), i);
         }
         Console.ReadLine();

      }

      static void DoWork(object state)
      {
         int threadNumber = (int)state;
         Console.WriteLine("Wątek {0} zgłasza gotowość do pracy.", state);
      }
   }
}
