did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780470289624

Professional Multicore Programming : Design and Implementation for C++ Developers

by ;
  • ISBN13:

    9780470289624

  • ISBN10:

    0470289627

  • Edition: 1st
  • Format: Paperback
  • Copyright: 2008-09-09
  • Publisher: Wrox
  • Purchase Benefits
List Price: $59.99

Summary

"This practical book shifts the focus from sequential programming techniques to parallel and multithreaded programming techniques and introduces you to the everyday fundamentals of programming for multiprocessor and multithreaded architectures." "This book is for developers of various skill levels who are making the move into multicore programming and application development."--BOOK JACKET.

Author Biography

Cameron Hughes is a professional software developer. He is a software engineer at CTEST Laboratories and a staff programmer/analyst at Youngstown State University. With over 15 years as a software developer, Cameron Hughes has been involved in software development efforts of all sizes, from business and industrial applications to aerospace design and development projects. Cameron is the designer of the Cognopaedia and is currently project leader on the GRIOT project that runs on the Pantheon at CTEST Laboratories. The Pantheon is a 24 node multicore cluster that is used in the development of multithreaded search engine and text extraction programs.

Tracey Hughes is a senior graphics programmer at CTEST Laboratories, where she develops knowledge and information visualization software. Tracey Hughes is the lead designer for the M.I.N.D, C.R.A.I.G, and NOFAQS projects that utilize epistemic visualization at CTEST Laboratories. She regularly contributes to Linux development software efforts. She is also a team member on the GRIOT project.
Cameron and Tracey Hughes are also the authors of six books on software development, multithreaded, and parallel programming: Parallel and Distributed Programming Using C (Addison Wesley, 2003), Linux Rapid Application Development (Hungry Minds, 2000), Mastering the Standard C++ Classes (Wiley, 1999), Object - Oriented Multithreading Using C (Wiley, 1997), Collection and Container Classes in C++ (Wiley, 1996), and Object - Oriented I/O Using C Iostreams (Wiley, 1995).

Table of Contents

Introductionp. xxi
The New Architecturep. 1
What Is a Multicore?p. 2
Multicore Architecturesp. 2
Hybrid Multicore Architecturesp. 3
The Software Developer's Viewpointp. 4
The Basic Processor Architecturep. 5
The CPU (Instruction Set)p. 7
Memory Is the Keyp. 9
Registersp. 11
Cachep. 12
Main Memoryp. 13
The Bus Connectionp. 14
From Single Core to Multicorep. 15
Multiprogramming and Multiprocessingp. 15
Parallel Programmingp. 15
Multicore Application Design and Implementationp. 16
Summaryp. 17
Four Effective Multicore Designsp. 19
The AMD Multicore Opteronp. 21
Opteron's Direct Connect and HyperTransportp. 22
System Request Interface and Crossbarp. 23
The Opteron Is NUMAp. 24
Cache and the Multiprocessor Opteronp. 25
The Sun UltraSparc T1 Multiprocessorp. 25
Program Profile 2-1p. 26
UltraSparc T1 Coresp. 27
Cross Talk and The Crossbarp. 27
DDRAM Controller and L2 Cachep. 28
UltraSparc T1 and the Sun and GNU gcc Compilersp. 28
The IBM Cell Broadband Enginep. 28
CBE and Linuxp. 29
CBE Memory Modelsp. 29
Hidden from the Operating Systemp. 30
Synergistic Processor Unitp. 31
Intel Core 2 Duo Processorp. 31
Northbridge and Southbridgep. 32
Intel's PCI Expressp. 32
Core 2 Duo's Instruction Setp. 32
Summaryp. 33
The Challenges of Multicore Programmingp. 35
What Is the Sequential Model?p. 36
What Is Concurrency?p. 37
Software Developmentp. 37
Software Decompositionp. 41
Task-to-Task Communicationp. 47
Concurrent Access to Data or Resources by Multiple Tasks or Agentsp. 51
Identifying the Relationships between Concurrently Executing Tasksp. 56
Controlling Resource Contention Between Tasksp. 59
How Many Processes or Threads Are Enough?p. 59
Finding Reliable and Reproducible Debugging and Testingp. 60
Communicating a Design That Has Multiprocessing Componentsp. 61
Implementing Multiprocessing and Multithreading in C++p. 62
C++ Developers Have to Learn New Librariesp. 63
Processor Architecture Challengesp. 64
Summaryp. 64
The Operating System's Rolep. 67
What Part Does the Operating System Play?p. 68
Providing a Consistent Interfacep. 68
Managing Hardware Resources and Other Software Applicationsp. 68
The Developer's Interaction with the Operating Systemp. 69
Core Operating System Servicesp. 71
The Application Programmer's Interfacep. 75
Decomposition and the Operating System's Rolep. 83
Hiding the Operating System's Rolep. 86
Taking Advantage of C++ Power of Abstraction and Encapsulationp. 86
Interface Classes for the POSIX APIsp. 86
Summaryp. 93
Processes, C++ Interface Classes, and Predicatesp. 95
We Say Multicore, We Mean Multiprocessorp. 96
What Is a Process?p. 97
Why Processes and Not Threads?p. 97
Using posix_spawn()p. 98
The file_actions Parameterp. 99
The attrp Parameterp. 100
A Simple posix_spawn() Examplep. 103
The guess_it Program Using posix_spawnp. 104
Who Is the Parent? Who Is the Child?p. 107
Processes: A Closer Lookp. 108
Process Control Blockp. 108
Anatomy of a Processp. 109
Process Statesp. 111
How Are Processes Scheduled?p. 114
Monitoring Processes with the ps Utilityp. 116
Setting and Getting Process Prioritiesp. 119
What Is a Context Switch?p. 121
The Activities in Process Creationp. 121
Using the fork() Function Callp. 122
Using the exec() Family of System Callsp. 122
Working with Process Environment Variablesp. 126
Using system() to Spawn Processesp. 127
Killing a Processp. 127
The exit(), and abort() Callsp. 128
The kill() Functionp. 128
Process Resourcesp. 129
Types of Resourcesp. 130
POSIX Functions to Set Resource Limitsp. 131
What Are Asynchronous and Synchronous Processesp. 133
Synchronous vs. Asynchronous Processes for fork(), posix_spawn(), system(), and exec()p. 135
The wait() Function Callp. 135
Predicates, Processes, and Interface Classesp. 137
Program Profile 5-1p. 138
Summaryp. 141
Multithreadingp. 143
What Is a Thread?p. 143
User- and Kernel-Level Threadsp. 144
Thread Contextp. 147
Hardware Threads and Software Threadsp. 149
Thread Resourcesp. 149
Comparing Threads to Processesp. 150
Context Switchingp. 150
Throughputp. 150
Communicating between Entitiesp. 150
Corrupting Process Datap. 151
Killing the Entire Processp. 151
Reuse by Other Programsp. 151
Key Similarities and Differences between Threads and Processesp. 152
Setting Thread Attributesp. 153
The Architecture of a Threadp. 155
Thread Statesp. 156
Scheduling and Thread Contention Scopep. 157
Scheduling Policy and Priorityp. 159
Scheduling Allocation Domainsp. 160
A Simple Threaded Programp. 160
Compiling and Linking Threaded Programsp. 162
Creating Threadsp. 162
Passing Arguments to a Threadp. 163
Program Profile 6-1p. 165
Joining Threadsp. 165
Getting the Thread Idp. 166
Using the Pthread Attribute Objectp. 167
Managing Threadsp. 171
Terminating Threadsp. 171
Managing the Thread's Stackp. 180
Setting Thread Scheduling and Prioritiesp. 183
Setting Contention Scope of a Threadp. 187
Using sysconf()p. 188
Thread Safety and Librariesp. 190
Extending the Thread Interface Classp. 193
Program Profile 6-2p. 200
Summaryp. 200
Communication and Synchronization of Concurrent Tasksp. 203
Communication and Synchronizationp. 204
Dependency Relationshipsp. 205
Counting Tasks Dependenciesp. 208
What Is Interprocess Communication?p. 210
What Are Interthread Communications?p. 230
Synchronizing Concurrencyp. 238
Types of Synchronizationp. 239
Synchronizing Access to Datap. 240
Synchronization Mechanismsp. 246
Thread Strategy Approachesp. 268
Delegation Modelp. 269
Peer-to-Peer Modelp. 271
Producer-Consumer Modelp. 272
Pipeline Modelp. 273
SPMD and MPMD for Threadsp. 274
Decomposition and Encapsulation of Workp. 276
Problem Statementp. 276
Strategyp. 276
Observationp. 277
Problem and Solutionp. 277
Simple Agent Model Example of a Pipelinep. 278
Summaryp. 282
PADL and PBS: Approaches to Application Designp. 283
Designing Applications for Massive Multicore Processorsp. 284
What Is PADL?p. 287
Application Architecture Selectionp. 290
Concurrency Models in PADLp. 300
The Implementation Model of PADLp. 304
The Predicate Breakdown Structure (PBS)p. 326
An Example: PBS for the "Guess-My-Code" Gamep. 327
Connecting PBS, PADL, and the SDLCp. 328
Coding the PBSp. 328
Summaryp. 328
Modeling Software Systems That Require Concurrencyp. 331
What Is UML?p. 332
Modeling the Structure of a Systemp. 334
The Class Modelp. 334
Visualizing Classesp. 336
Ordering the Attributes and Servicesp. 343
Visualizing Instances of a Classp. 345
Visualizing Template Classesp. 348
Showing the Relationship between Classes and Objectsp. 349
Visualizing Interface Classesp. 353
The Organization of Interactive Objectsp. 356
UML and Concurrent Behaviorp. 357
Collaborating Objectsp. 357
Multitasking and Multithreading with Processes and Threadsp. 359
Message Sequences between Objectsp. 361
The Activities of Objectsp. 363
State Machinesp. 365
Visualizing the Whole Systemp. 371
Summaryp. 372
Testing and Logical Fault Tolerance for Parallel Programsp. 375
Can You Just Skip the Testing?p. 376
Five Concurrency Challenges That Must Be Checked during Testingp. 377
Failure: The Result of Defects and Faultsp. 379
Basic Testing Typesp. 379
Defect Removal versus Defect Survivalp. 380
How Do You Approach Defect Removal for Parallel Programs?p. 381
The Problem Statementp. 382
A Simple Strategy and Rough-Cut Solution Modelp. 382
A Revised Solution Model Using Layer 5 from PADLp. 382
The PBS of the Agent Solution Modelp. 383
What Are the Standard Software Engineering Tests?p. 386
Software Verification and Validationp. 387
The Code Doesn't Work - Now What?p. 388
What Is Logical Fault Tolerance?p. 391
Predicate Exceptions and Possible Worldsp. 397
What Is Model Checking?p. 398
Summaryp. 398
UML for Concurrent Designp. 401
Concurrency Modelsp. 411
POSIX Standard for Thread Managementp. 427
POSIX Standard for Process Managementp. 567
Bibliographyp. 593
Indexp. 597
Table of Contents provided by Ingram. All Rights Reserved.

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program