General advice for structuring concurrent code in C++