• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Concurrency Query

 
Ranch Hand
Posts: 49
Spring Redhat Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Ranch Hand
Posts: 49
Spring Redhat Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Anthony for the insight!

Looking forward for your book, which looks like a very interesting read!
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic