How it works...

From the console application, we can see that the processor count is 2. The minimum number of thread pool threads, therefore, also equals 2. We then read the maximum thread pool size and generate a random number between the minimum and maximum numbers. Lastly, we set the maximum thread pool size, to our randomly generated minimum and maximum.

While this is only a proof of concept and not something one would do in a production application (setting the thread pool to a random number), it clearly illustrates the ability to set the thread pool to a value specified by the developer.

The code in this recipe was compiled for 32-bit. Try changing your application to a 64-bit application and run the code again. See the difference a 64-bit makes.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.218.69