std::shared_ptr guaranteed to be thread safe. I do not know which mechanism uses typical implementations to ensure this, but, of course, it must have some overhead. And this overhead will be present even if your application is single-threaded.
Is it higher? And if so, does this mean that it violates the principle of "you do not pay for what you do not use" if you do not use the guarantees of thread safety?
c ++ multithreading shared-ptr
tjhance Sep 11 '14 at 6:44 2014-09-11 06:44
source share