Sunil Tiwari wrote:
1) How should we manage concurrency to increase performance of our C++ code?
That really depends what you are trying to do. One basic solution is to divide your tasks into the smallest pieces that can be run independently and submit them to a
thread pool, which can then divide them between the available processors. Of course, the details will depend on the application, and there are alternatives. I cover this in more depth in my book.
Sunil Tiwari wrote:
2) What is/are memory model(s) and how does choosing one affects the code performance?
Generally, you don't get to choose a memory model --- it is an inherent part of the language you are using.
The memory model defines how the language constructs such as
int, or
struct map to memory, and how/when changes made to a variable in one thread become visible to other threads. Chapter 5 covers the C++0x memory model in depth.