C++ Thread Pool Implementation