April 2017
Intermediate to advanced
628 pages
13h 46m
English
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.
Read now
Unlock full access