task queue and worker thread for C++