This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
master stewards:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
garden masters:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
gardeners:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Concurrency Query

 
pioneer
Posts: 49
Spring Redhat Clojure
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anthony,

Congratulations on your new book!

Two very basic queries on concurrency :

1) How should we manage concurrency to increase performance of our C++ code?

2) What is/are memory model(s) and how does choosing one affects the code performance?

- Sunil
 
author
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Sunil Tiwari
pioneer
Posts: 49
Spring Redhat Clojure
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Anthony for the insight!

Looking forward for your book, which looks like a very interesting read!
 
I AM MIGHTY! Especially when I hold this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!