C++ Multi-threaded Task Scheduler