Terry Harple wrote:What challenges to current concurrency methodologies do you foresee in a future where thousands of CPU core become the standard?
That is a good question. The primary shift I see is a move away from manual control of threads to higher level code where the library controls the number of threads and the distribution of work between them. The C++0x facilities have the beginnings of such support in the form of std::async, where the library can choose whether the task is run on its own thread or on the first thread to wait for the task to complete. However, in time I think we will see things move towards parallel algorithms (parallel_for_each etc) and things like dataflow frameworks where you specify the relationships between tasks and let the library handle the concurrency.
Vijitha Kumara wrote:How the new C++0x enables the use of multi-cores, is it really matured enough to that level or still evolving?
The C++0x memory model is designed to handle multiple cores, and multiple processors. At that level it has matured enough: no more language changes should be necessary. Compiling a single program across multiple types of processor might require further changes though --- Microsoft's recently announced C++AMP uses the "restrict" keyword to specify code that can run on a GPU, for example.
The libraries will continue to evolve --- the C++0x library itself is useful, but higher level libraries will make things much easier to deal with.
Wow, I bow both to the questioner here -- who asks a wonderful question -- and to Anthony AJ, whose answers, I think, are superb.
It should be noted that C++... with the new C++0x standard... is making serious moves to dealing with the multiple CPU future. I must apologize that I did not go much into the multi-thread material in my book, C++ Without Fear, because it is aimed at the beginner through intermediate programmer principally, and (at the moment at least) I see multi-threading as a very serious, super advanced subject. But someone is going to need to supply some solid examples and guidance on it. AJ?
There is also another possibility. Consider that in general, the move over the last few decades (in fact, since the 1950s!) has been away from programming "down to the hardware" and toward letting high-level tools, such as compilers, optimize the use of hardware for you. For example, some of the formerly cool programming tricks of C and C++ (such as declaring register variables) are now almost irrelevant, because the finest optimizer compilers... such as Microsoft... do this automatically for you.
So I can forsee a future where the finest optimizing compilers figure out for you how to download part of the work and delegate it to other processors. This ALREADY happens to some degree internally on today's computers... in which memory caching, video memory, and notably floating-point tasks are all handed off to other processors. This happens at such a low level now that most programmers (unless they are very hardware sophisticated) ever see it or are aware of it.
But yes, in the future it's going to be more important to master the parts of the C++0x spec that deal with multi-threading. If it's important to deal with multiple threads now, it can also be addressed by working with operating system calls.
Because C++ (and C++0x specifically) are state-of-the-art, if you are concerned with sophsticated handling of threads, it is a good reason to start learning C++ now... even with (as with my book) you start with the fundamentals.
Those are just my random thoughts on the subject. Hope this helps,