5

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?

ildjarn
  • 62,044
  • 9
  • 127
  • 211
David Adrian
  • 1,079
  • 2
  • 9
  • 24
  • 3
    [This one](http://en.cppreference.com/w/cpp/thread) seems pretty up to date ([here for atomics](http://en.cppreference.com/w/cpp/atomic)). – Some programmer dude Apr 12 '13 at 17:54
  • 2
    [This site](http://en.cppreference.com/w/cpp/thread) isn't too bad... – dreamlax Apr 12 '13 at 17:55
  • 4
    The new edition of _The C++ Standard Library - A Tutorial and Reference_ does cover `std::thread`; see chapter 18. – bames53 Apr 12 '13 at 18:58
  • @bames53, I didn't have access to a copy at the time I asked the question, so I checked the index online, and it wasn't there. However, now that I'm looking at a physical copy, I see that it's there. Thanks for point that out, I must have missed it the first time flipped through the ToC. – David Adrian Apr 12 '13 at 21:41
  • 3
    One of the most cited reference for C++11 concurrency is "C++ Concurrency in Action: Practical Multithreading" by Anthony Williams. Anthony is a member of the C++ committee and one of the threads library designer. – Cassio Neri Apr 12 '13 at 23:40

1 Answers1

10

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!

templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065
  • 1
    The argumentation " I would strongly suggest not using cplusplus.com as a reference. It's known to have had some inaccuracies in the past" is nonsense. If it was in the past, now is OK, by the definition of "past". does It HAVE or HAVE NO inaccuracies NOW ? – Emilio Garavaglia Apr 12 '13 at 19:01
  • 3
    @EmilioGaravaglia- I am not sure how accurate cplusplus.com is at the moment. You are correct that the argument "it has been bad in the past, so it must be bad now" is completely invalid. However, the fact that it doesn't currently cover threads, atomics, etc. is certainly supporting evidence that it is incomplete/incorrect, and there are other websites that are known to be more complete. – templatetypedef Apr 12 '13 at 19:03
  • 2
    It is still bad, in particular the tutorials. So it is not a good idea to direct people, especially not beginners, to that site. – Zyx 2000 Apr 12 '13 at 21:52
  • I don't bother with the tutorials/articles/etc on cplusplus.com. I do, however, use it regularly for reference documentation. "It was inaccurate in the past" isn't helpful. What specific things are currently (or until very recently) were inaccurate? (The fact they were slower than some other sites to fully document C++11 isn't really fair, IMHO.) Especially, was there bad information on there that would lead someone to write *incorrect code*? – James Johnston Oct 09 '14 at 19:56
  • (My reasons for using cplusplus.com are somewhat superficial; it tends to come up higher in the Google results, and I happen to prefer the site layout and arrangement - especially the left-hand-side navigation.) – James Johnston Oct 09 '14 at 19:57