This article describes the operation method of C# thread pool. Share it for your reference. The details are as follows:
static void Main(string[] args) { //Set the maximum number of threads in the thread pool is 1000. //The first one is the worker thread, the second one is the I/O thread (1000, 1000); for (int i = 0; i < 10;i ) { (new WaitCallback(ShowMessage), ("Current number{0}",i)); } (); } //With parameters No return valuestatic void ShowMessage(object x) { string current = ("Current threadidfor{0}", System. ); //Wait for 1 second (1000); (("{0},输入for{1}", current, x)); }
I hope this article will be helpful to everyone's C# programming.