David Adrian
David Adrian

Reputation: 1109

How standard is std::thread?

I've noticed that on a lot of the classic C++ reference sources that HAVE been updated for C++11, such as cplusplus.com and the Josuttis Standard Library Reference book, don't seem to cover / have any documentation at all on the C++11 concurrency standard library features, such as std::thread, std::atomic, and std::async.

Are these concurrency features somehow "less standard" than the rest of the standard library? Or is the documentation just lacking for some other reason?

Upvotes: 5

Views: 464

Answers (1)

templatetypedef
templatetypedef

Reputation: 372992

All of the libraries you've referenced are indeed a part of the C++11 standard. In fact, a lot of the language rules were reworked to describe how operations work in a multithreaded environment (previously, the spec didn't specify any semantics for how threads would work).

I can't say why the documentation is lacking on those sites, since I don't know who runs them, but threads, atomics, etc. are definitely a part of C++11.

On a related note, I would strongly suggest not using cplusplus.com as a reference. It's known to have had some inaccuracies in the past, and other sites (namely, cppreference.com) are a lot more complete and accurate.

Hope this helps!

Upvotes: 10

Related Questions