Errata
The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".
The following errata were submitted by our customers and approved as valid errors by the author or editor.
Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update
Version | Location | Description | Submitted By | Date submitted | Date corrected |
---|---|---|---|---|---|
Printed | Page 44 Example 2-6 |
To work with zero-based indexing, the left hand side of the assignment should be "B[k+3]". |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 62 example 3-5 Dekkers Algorithm |
int favored; Note from the Author or Editor: |
Anonymous | Jul 21, 2009 | |
Printed | Page 72 Fourth paragraph, first sentence |
"Execution" should be "Extension". Thus, the sentence should start with... |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 89 middle of the page |
The functions listed as "pthread_lock()" and "pthread_unlock()" should be "pthread_mutex_lock()" and "pthread_mutex_unlock()", respectively. |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 90 Example 5-3 |
The example code in example 5-3 does not compile, as the function threadFunction is defined as returning a void *, which it then fails to do. Note from the Author or Editor: |
John Hardman | Jul 01, 2009 | |
Printed | Page 99 Example 6-3 |
Example 6-3 contains a call to InitializeArry instead of InitializeArray (as described in the text and as per other examples). Note from the Author or Editor: |
John Hardman | Jul 01, 2009 | |
Printed | Page 99 Example 6-3 and Example 6-4 (on page 100) |
The text says Note from the Author or Editor: |
John Hardman | Jul 01, 2009 | |
Printed | Page 100 Example 6-4 |
Use of the combination of new/free to allocate and deallocate dynamic memory is not a good idea. To correct, either replace the use of "new" with "malloc" or replace "free" with "delete". The changes to code in Example 6-4 using the latter fix would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 105 Figure 6-4 |
Last box in second row (from top) says "5-7". This should be "6-7". |
Clay Breshears |
Dec 21, 2009 | |
Printed | Page 108 Example 6-8 |
The "HANDLE" declaration in the main() function has the wrong variable name. This line should be... |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 108 Example 6-8, prefixScan() function |
Use of the combination new/free to allocate and deallocate dynamic memory is not a good idea. To correct, either replace the use of "new" with "malloc" or replace "free" with "delete". The changes to the top of the prefixScan() function code in Example 6-8 using the latter fix would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 113 Example 6-10 |
Use of the combination new/free to allocate and deallocate dynamic memory is not a good idea. To correct, either replace the use of "new" with "malloc" or replace "free" with "delete". The changes to code in Example 6-10 using the latter fix would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 116 Example 6-12 |
Use of the combination new/free to allocate and deallocate dynamic memory is not a good idea. To correct, either replace the use of "new" with "malloc" or replace "free" with "delete". The changes to code in Example 6-12 using the latter fix would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 119 Example 6-15 |
There will be a memory leak in Example 6-15 without a delete of the new memory allocation. The better ArrayPack() function code would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 130 6th line from bottom |
und so veiter Note from the Author or Editor: |
Anonymous | Aug 06, 2010 | |
Printed | Page 131 Example 7-2 |
The function SumByReduction is defined as returning a void *, which it fails to do. A strict compiler will not allow this to build. Note from the Author or Editor: |
John Hardman | Jul 01, 2009 | |
Printed | Page 131 Example 7-2, fourth line from bottom of page |
The ampershand (&) used in the pthread_join() call should be removed. The pthread_t object itself, not a pointer to the object must be used. This source line should be... |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 131 Example 7-2 |
Use of the combination new/free to allocate and deallocate dynamic memory is not a good idea. To correct, either replace the use of "new" with "malloc" or replace "free" with "delete". The changes to the last executable line of code in the SumByReduction() function in Example 7-2 using the latter fix would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 135 Code for pth_barrier() function at bottom of page |
The broadcast in the "else" clause is better executed after the update of the barrier fields. The mutex unlock after the if-then-else will ensure that no threads that have been awakened have access to the barrier object before these values are set. The code for this clause should be... |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 135 Code segment at the top of the page |
The colon (:) at the end of the first code segment should be a semi-colon (;). Thus, the code segement should be... |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 135 Second source code segment |
The first underscore character (_) has been dropped from the pthread_cond_init() function call. The correct line should be... |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 140 Example 7-3 |
There will be a memory leak in Example 7-3 without a delete of the new memory allocations. The last two lines at the end of the code segment (end of the FriendlyNumbers() function) should be expanded to be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 156 Example 8-5 |
The bounds of the for-loop are incorrect. The termination condition should be "N-1" not "N", as it is given in the first algorithm attempt in Example 8-4. Thus, the correct line should be... |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 157 Example 8-6 |
"#pargma omp parallel" should be "#pragma omp parallel" |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 158 Example 8-6 |
The bounds of the for-loop are incorrect. The termination condition should be "N-1" not "N", as it is given in the serial algorithm (Example 8-3). Thus, the correct line should be...<p> |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 158 Example 8-6, second critical region |
The correct function name to call is omp_get_num_threads(). The correct line in the OpenMP critical (within the for-loop) should be... |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 166 examples 8-10 and 8-11 |
The code as is will cause a segfault. In order to fix this, this line: Note from the Author or Editor: |
Geoffrey Fairchild | Sep 29, 2010 | |
Printed | Page 172 Example 8-13 |
The third parameter of WaitForMultipleObjects() was left out. The correct third parameter should be "TRUE". The correct line should be... |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 173 Example 8-14 |
Use of the combination new/free to allocate and deallocate dynamic memory is not a good idea. To correct, either replace the use of "new" with "malloc" or replace "free" with "delete". The first few lines of the while-loop code in Example 8-14 using the latter fix would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 179 Example 8-17 |
Use of the combination new/free to allocate and deallocate dynamic memory is not a good idea. To correct, either replace the use of "new" with "malloc" or replace "free" with "delete". The first few lines of the while-loop code in Example 8-17 using the latter fix would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 184 Example 8-19 |
The while loop line in RadixExchangeSort() should be: |
Clay Breshears |
Dec 21, 2009 | |
Printed | Page 184 Example 8-19 |
Use of the combination new/free to allocate and deallocate dynamic memory is not a good idea. To correct, either replace the use of "new" with "malloc" or replace "free" with "delete". The first few lines of the while-loop code in the RadixExchangeSort() function in Example 8-19 using the latter fix would be...< |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 187 Example 8-20 |
Use of pointers will not work if an odd number of iterations within the given function are executed. Better, more general code for the example would be: |
Clay Breshears |
Dec 21, 2009 | |
Printed | Page 189 within "Note" |
The last sentence of the note begins "This scheme is only scalable to the number of different bit patterns used (mbits squared) and requires all ...." Note from the Author or Editor: |
Robert H. Stine, Jr. | Feb 28, 2011 | |
Printed | Page 191 Example 8-21 |
Use of pointers will not work if an odd number of iterations within the given function are executed. Better, more general code for the example would be: |
Clay Breshears |
Dec 21, 2009 | |
Printed | Page 194 Figure 8-11 |
gcount[1] holds "1". This value should be "2". |
Clay Breshears |
Dec 21, 2009 | |
Printed | Page 195 Example 8-22 |
The variable "offset" is not used in the function; the declaration can be removed. The final declaration line should be... |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 196 Example 8-22 |
The function ParallelStraightRadixSort is defined as returning a void *, which it fails to do. A strict compiler will not allow this to build. Note from the Author or Editor: |
John Hardman | Jul 01, 2009 | |
Printed | Page 206 Example 9-4 |
The function pSearch is defined as returning a function, but it does not do so. A strict compiler will not allow this code to build. Note from the Author or Editor: |
John Hardman | Jul 01, 2009 | |
Printed | Page 206 Example 9-4 |
Use of the combination new/free to allocate and deallocate dynamic memory is not a good idea. To correct, either replace the use of "new" with "malloc" or replace "free" with "delete". The changes to to the last few lines of code in the pSearch() function in Example 9-4 using the latter fix would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 214 Example 9-7 |
There will be a memory leak in Example 9-7 without a delete of the new memory allocations. The last few lines of the NarySearch() function code would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 217 Example 9-8 |
There will be a memory leak in Example 9-8 without a delete of the new memory allocations. The last few lines of the NarySearch() function code would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 222 Third paragraph, first sentence |
The phrase "edge pairs" makes no sense. The first line should read... |
Clay Breshears |
Dec 22, 2009 | |
Printed | Page 233 Example 10-5 |
The original code is not wrong. As it is, the call to ReleaseSemaphore() is done each time the "if" condition is true. The idea was to keep a count and then call this function once. This can be done by the following change to the relevant conditional code given in Example 10-5: |
Clay Breshears |
Dec 21, 2009 | |
Printed | Page 244 Second sentence of second full paragraph |
The correct sentence should be: |
Clay Breshears |
Dec 21, 2009 | |
Printed | Page 249 Example 10-9 |
Use of the combination new/free to allocate and deallocate dynamic memory is not a good idea. To correct, either replace the use of "new" with "malloc" or replace "free" with "delete". The last few lines of the Prims() function code in Example 10-9 using the latter fix would be... |
Clay Breshears |
Dec 23, 2009 | |
Printed | Page 253 Example 10-11 |
There will be a memory leak in Example 10-11 without a delete of the new memory allocations. To fix this, the last few lines of the cPrims() function code in Example 10-11 should be... |
Clay Breshears |
Dec 23, 2009 |