I am using std::vector as shared data in a multi-threaded application. I encapsulate the thread inside a class, e.g.,
class ABC { public: double a, b, c
Maybe you could use this instead?
concurrent_vector... from the Intel Threading Building Blocks
https://software.intel.com/en-us/node/467758