public class TestClass { static void Main() { ThreadPool.SetMaxThreads(5, 5); for (int x = 0; x < 10; x++) { ThreadPool.QueueUserWorkItem(new WaitCallback(printnum), x); } Console.ReadKey(); } public static void printnum(object n) { Console.WriteLine("Call " + n); for (int i = 0; i < 10; i++) { Console.WriteLine(i); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)