Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 777
David Adrian Avatar asked Apr 12 '13 17:04

David Adrian


1 Answers

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!

like image 153
templatetypedef Avatar answered Sep 27 '22 20:09

templatetypedef