Thread pool in C++