Another thing I noticed is that it could be better (for performance) to use less threads. If you have lots of threads in a pool, they are constantly waking up and going to sleep if you have certain pattern in task scheduling. E.g. a lot of tasks, then few tasks, then a lot of tasks, then few, etc.