There's more...
The PPL greatly simplifies multithreading programming; however, the biggest advantage is the ThreadPool, which does the dirty job of creating, destroying, and reusing the background threads. So please, don't see the PPL as a different way to create threads; it is a powerful mechanism to correctly handle multiple threads without saturating the CPUs. Remember that when you ask the PPL to start a task, the task may not start immediately. This is because the ThreadPool may decide to put your task in the waiting queue and actually start it ASAP, but not now. The great thing is that this is actually not a problem but a feature, because, otherwise, you will easily saturate the CPUs' resources. In my own experience, in complex situations, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access