Basic linear container with multi-threading support in C++