C++0X Standard in support of Multi-threaded Programs - c++

C++ Standards committe is to publish the new standards for the language we all love so much in 2010 and the biggest support that is being provided, is for multi-threaded applications.... this sounds exciting .... any more inputs on this????

If you don't have a specific question regarding the new standards, I recommend doing some Wikipedia/Google reading. Also, check out these c++0x StackOverflow questions.

For C++0x threads, check out http://www.stdthread.co.uk/. It's a complete implementation of the C++0x threading libraries, written by the guy who wrote a lot of the proposals that made it into the standard.

Prasoon already linked to my article on Devx.com, and Terry linked to my implementation of the C++0x thread library.
You might also be interested in the series of posts on my blog about multithreading in C++0x, or in my book C++ Concurrency in Action where I go into greater detail about the details of multithreading with C++0x.

Related

Is there any C++ coding standard like PSR-1/2

I was searching for C++ coding standard.
I found lots of standards:
Google C++ Style Guide
High Integrity C++ Coding Standard Version 4.0
...
Is there any C++ coding standard like PSR-1/21 that every C++ developer follows?
1) PHP Standard Recommendation. PSR-1: Basic Coding Standard. PSR-2: Coding Style Guide.
Is there any C++ coding standard like PSR-1/2 that every C++ developer follows?
The C++ language standard is made official by the ISO C++ Committee.
The standard comes with iterations and versionings (like c++-11, c++-14, c++-17) that are (mostly) backwards compatible.
That's actually what every C++ developer needs to follow.
If you're actually asking about coding style guides, that's a different thing, and no there aren't any common standards, beyond what's forbidden/discouraged from the c++ standard language.
Well, rethinking the standard style guide wording, there actually are established coding style standards like e.g. Misra C++.
You'll need to consider fulfilling these to get into certain business domains. You may think these are silly, and too restrictive, but still the customer wants you to fulfill these style guides.
It's your choice, and you'll need to estimate your extra efforts and costs (for e.g. investing in a static analysis tool that confirms standard compliance), and put that on the customers bill.
Even though I think the given answers are already good i would like to add the following comment:
There is a rather new project C++ Core Guidelines which tries to do what you are looking for (at least I think so). It is still in an ongoing process but IMHO it is already worth to take a look. There are also some nice talks about these guidelines
CppCon 2015: Bjarne Stroustrup “Writing Good C++14”
and
CppCon 2015: Herb Sutter "Writing Good C++14... By Default"
which explains its main purpose quite nicely. They emphasize static code analysis alot and in my opinion they try to push it alot with these guidelines.
But an important information is
FAQ.6: Have these guidelines been approved by the ISO C++ standards
committee? Do they represent the consensus of the committee?
No. These guidelines are outside the standard. They are intended to
serve the standard, and be maintained as current guidelines about how
to use the current Standard C++ effectively. We aim to keep them in
sync with the standard as that is evolved by the committee.
In the end it means, it is just another set of rules in the sense of the other answers.
No.
If there were a single style guide that everybody followed, why would there be multiple style guides?
For what it's worth, I don't follow anyone else's style guide, and in my opinion neither should you.
Your job may require you to follow a certain guide, but then you wouldn't be asking us which to use.
Notice that I refuse to call these style guides "standards".

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?
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!

Please advise a worthy book on multithreading with boost.thread or C++11

Which book is worth buying, for your opinion? I'm generally familiar with multithreading concepts, OpenMP, basic WinAPI threading. I want now to learn to use new std::thread or boost.thread effectively - I'm unfamiliar with things like atomics, conditional variables, etc.
I don't know this book but the title got my attention: C++ Concurrency in Action. Perhaps it contains what you need, just take a look at the preview. It has some information about C++11

C++ STL containers, 'under the bonnet'?

what would be the best way to learn what actually happens with the STL containers? I presume just programming wouldnt be enough. Are there any books specifically aimed at this?
This book is quite good, even if maybe it does not go deep enough in the details as you would like: The C++ Standard Library: A Tutorial and Reference
Generic Programming and the STL: Using and Extending the C++ Standard Template Library
The best way to figure out what's happening 'under the bonnet' is to actually look under the hood and find the source code :)
Otherwise just read the documentation. I recommend this site, or this book.
Stephan T. Lavavej is currently doing video lectures about the STL.
There are books dedicated for C++ STL. You could try one of those.
Found the below resources quite useful:
May not be up-to-date but SGI Stl Programmer's Guide. It has a good conceptual overview of the STL library.
Source code navigation:
I've used the Free Evaluation Source Insight Code Browser which allows to jump all around the source code from sgi's stl code.
Alternatively you can try out LXR, doxygen, Ctags.
Videos:
STL Tutorial by Stephen Lavavej
Going Deep into STL with Stephen Lavavej
Inside STL with Stepan Lavavej
C++0x Features in VC10
See Also:
C++ Templates - The Complete Guide by Nicolai Josuttis
C++ Template Meta-Programming - Concepts, Tools and Techniques
Inside the C++ Object Model by Stanley Lippman

What do I need to know about C++0x? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Where can I learn more about C++0x?
I am fairly familiar with C++03 but I still need to come to terms with C++0x so I would like to read some fairly digestible information on C++0x.
I have looked at the Wikipedia but I am on the look out for something that is more readable. So is there a book or series of blog entries that provide a nice introduction to the matarial?
There is a ton of stuff on this very site - some of the posts include very informative discussion. I would point you to Google but it's going to be more efficient to search in C++0x tagged posts here imo.
Here's a good one to start with, which includes indirection to Stroustrup's own summary. Scott Meyers has presentation materials on the topic here.
Check up on your favourite compiler's support for the new version. Microsoft VC10 support is summarized here. GCC info can be found here.
Official state of the standard for the language is available here. Evolution of the language is in many places tied to ongoing work in Boost. See here for some info on that.
Honestly my preference these days is to look here for 99% of needed info rather than resort to a book.
It's too early for a book. The standard isn't fixed yet.
Now, if you think wikipedia is hard to read, you might try Stroustrup's page about it. However it might seem harder to read to some.
There's a good tutorial on codeproject here for VC++. Even if you aren't using Visual Studio though it's still useful.
Learn whatever feature you would have loved having in C++98 in the first place. For me, it was variadic templates, lambda functions, decltype and other cool stuff.
If you still don't know what to learn first, maybe you should try to understand what issues from the C++98 are adressed. I say this because all the xvalue, move semantics and al stuff is quite heavy to grasp if you don't know what the problems were (and still are btw). This may imply learning some more C++98 first.
Then, you can always browse the Wikipedia article and look at whatever you find cool. Implementors don't provide all the features yet, so you'll look like a 5 year old staring at the front window of a toy store. This is a good reason to behave like one.
I really liked this series of blog posts by the Visual C++ Team Blog:
The Future of the C++ Language
Lambdas, auto, and static_assert: C++0x Features in VC10, Part 1
Rvalue References: C++0x Features in VC10, Part 2
decltype: C++0x Features in VC10, Part 3
I found the Overview of the New C++ (C++0x) book by Scott Meyers to be a good, detailed summary of the main features. It's more of a presentation with very detailed footnotes that an actual book, but it's still an excellent, short read.
I suggest you using the book functionality of Wikipedia to make it more readable/printable. I did the same for the C++0x page.