Errata

Parallel Programming with Microsoft® Visual C++®

Errata for Parallel Programming with Microsoft® Visual C++®

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed, PDF, ePub, Mobi, Page 14
various

Codeplex: Niels_Dekker wrote Sep 1, 2011 at 8:15 AM

Chapter 2, Parallel Loops, shows four calls to Concurrency::parallel_for<_Index_type,_Function>, each of them having an unsigned int ('0u') as first argument, and either a size_t or a vector::size_type as second argument. This causes compile errors when the target platform is x64:

error C2782: 'void Concurrency::parallel_for(_Index_type,_Index_type,const _Function &)' : template parameter '_Index_type' is ambiguous

I would suggest to explicitly specify the first template argument:
Find what: 'parallel_for(0u'
Replace with: 'parallel_for<size_t>(0u'

Ade Miller
Ade Miller
 
Oct 18, 2012 
Printed, PDF, ePub, Mobi, Page 96
5th paragraph onwards

Codeplex: jsh003guardz63 wrote Jul 19, 2011 at 9:20 AM

The explanation of performance characteristics of pipelines on p96 needs clarification and possibly correction.

In particular, ?If there are enough available cores, and if all stages of a pipeline take an equal amount of time, the execution time for the pipeline as a whole is the same as the time for just one stage?, would appear to be incorrect.

If:
S = the number of stages in figure 4 (= 4)
N = the number of images in figure 4 (= 6)
T = the duration to process one stage for one image (= t1 - t0 = t2 ? t1)
Then:
The elapsed time for a completely parallel and completely efficient pipeline is (S+N-1) * T.
The elapsed time taken for one stage = N * T.
But:
(S+N-1) x T is only equal to N * T when S = 1.

If the sidebar on p96 is referring to the case where S = 1, the phrasing of that sidebar needs changing, as it currently implies that (S+N-1) x T = N * T for any S. If the sidebar isn't referring to the case where S = 1, it needs re-wording as its intended meaning is unclear and/or incorrect. Possibly, it's trying to say that each core has an equal execution time, but I don't think that's the intended meaning... it?s hard to be sure what it is trying to say.

Ade Miller
Ade Miller
 
Oct 18, 2012