Intel Threading Building Blocks: Outfitting C++ for Multi-core Processor Parallelism (Paperback) (Intel 線程建構模塊:為 C++ 配備多核心處理器的平行運算)

James Reinders

  • 出版商: O'Reilly
  • 出版日期: 2007-08-21
  • 定價: $1,480
  • 售價: 9.5$1,406
  • 貴賓價: 9.0$1,332
  • 語言: 英文
  • 頁數: 336
  • 裝訂: Paperback
  • ISBN: 0596514808
  • ISBN-13: 9780596514808
  • 相關分類: C++ 程式語言
  • 立即出貨 (庫存 < 4)

買這商品的人也買了...

相關主題

商品描述

Description

Multi-core chips from Intel and AMD offer a dramatic boost in speed and responsiveness, and plenty of opportunities for multiprocessing on ordinary desktop computers. But they also present a challenge: More than ever, multithreading is a requirement for good performance. This guide explains how to maximize the benefits of these processors through a portable C++ library that works on Windows, Linux, Macintosh, and Unix systems. With it, you'll learn how to use Intel Threading Building Blocks (TBB) effectively for parallel programming -- without having to be a threading expert.

Written by James Reinders, Chief Evangelist of Intel Software Products, and based on the experience of Intel's developers and customers, this book explains the key tasks in multithreading and how to accomplish them with TBB in a portable and robust manner. With plenty of examples and full reference material, the book lays out common patterns of uses, reveals the gotchas in TBB, and gives important guidelines for choosing among alternatives in order to get the best performance.

You'll learn how Intel Threading Building Blocks:
  • Enables you to specify tasks instead of threads for better portability, easier programming, more understandable source code, and better performance and scalability in general
  • Focuses on the goal of parallelizing computationally intensive work to deliver high-level solutions
  • Is compatible with other threading packages, and doesn't force you to pick one package for your entire program
  • Emphasizes scalable, data-parallel programming, which allows program performance to increase as you add processors
  • Relies on generic programming, which enables you to write the best possible algorithms with the fewest constraints
Any C++ programmer who wants to write an application to run on a multi-core system will benefit from this book. TBB is also very approachable for a C programmer or a C++ programmer without much experience with templates. Best of all, you don't need experience with parallel programming or multi-core processors to use this book.

Table of Contents

Foreword

Note from the Lead Developer of Intel Threading Building Blocks

Preface

1. Why Threading Building Blocks?

     Overview

     Benefits

2. Thinking Parallel

     Elements of Thinking Parallel

     Decomposition

     Scaling and Speedup

     What Is a Thread?

     Mutual Exclusion and Locks

     Correctness

     Abstraction

     Patterns

     Intuition

3. Basic Algorithms

     Initializing and Terminating the Library

     Loop Parallelization

     Recursive Range Specifications

     Summary of Loops

4. Advanced Algorithms

     Parallel Algorithms for Streams

5. Containers

     concurrent_queue

     concurrent_vector

     concurrent_hash_map

6. Scalable Memory Allocation

     Limitations

     Problems in Memory Allocation

     Memory Allocators

     Replacing malloc, new, and delete

7. Mutual Exclusion

     When to Use Mutual Exclusion

     Mutexes

     Mutexes

     Atomic Operations

8. Timing

9. Task Scheduler

     When Task-Based Programming Is Inappropriate

     Much Better Than Raw Native Threads

     Initializing the Library Is Your Job

     Example Program for Fibonacci Numbers

     Task Scheduling Overview

     How Task Scheduling Works

     Recommended Task Recurrence Patterns

     Making Best Use of the Scheduler

     Task Scheduler Interfaces

     Task Scheduler Summary

10. Keys to Success

     Key Steps to Success

     Relaxed Sequential Execution

     Safe Concurrency for Methods and Libraries

     Debug Versus Release

     For Efficiency's Sake

     Enabling Debugging Features

     Mixing with Other Threading Packages

     Naming Conventions

11. Examples

     The Aha! Factor

     A Few Other Key Points

     parallel_for Examples

     The Game of Life

     Parallel_reduce Examples

     CountStrings: Using concurrent_hash_map

     Quicksort: Visualizing Task Stealing

     A Better Matrix Multiply (Strassen)

     Advanced Task Programming

     Packet Processing Pipeline

     Memory Allocation

     Game Threading Example

     Physics Interaction and Update Code

     Open Dynamics Engine

12. History and Related Projects

     Libraries

     Languages

     Pragmas

     Generic Programming

     Caches

     Costs of Time Slicing

     Quick Introduction to Lambda Functions

     Further Reading

Index  

 

商品描述(中文翻譯)

描述

多核芯片由英特爾和AMD提供,可以大幅提升速度和反應能力,並為普通桌面電腦提供了許多多處理的機會。但是,它們也帶來了一個挑戰:多線程是良好性能的要求。本指南介紹了如何通過一個可在Windows、Linux、Macintosh和Unix系統上運行的可移植C++庫來最大化這些處理器的好處。通過這本書,您將學習如何有效地使用英特爾線程構建塊(TBB)進行並行編程,而無需成為線程專家。

本書由英特爾軟件產品的首席傳教士James Reinders撰寫,基於英特爾的開發人員和客戶的經驗,該書解釋了多線程中的關鍵任務以及如何以可移植和堅固的方式使用TBB來完成這些任務。書中提供了大量的示例和完整的參考資料,介紹了常見的使用模式,揭示了TBB中的注意事項,並提供了在選擇不同方案時獲得最佳性能的重要指南。

您將學習到英特爾線程構建塊的以下特點:
- 通過指定任務而不是線程來提高可移植性、編程更容易、源代碼更易理解,並獲得更好的性能和可擴展性
- 專注於並行化計算密集型工作的目標,提供高級解決方案
- 與其他線程包兼容,不強制您選擇一個包來完成整個程序
- 強調可擴展的數據並行編程,允許隨著添加處理器而提高程序性能
- 依賴於通用編程,使您能夠以最少的限制編寫最佳的算法

任何想要在多核系統上運行應用程序的C++程序員都會從本書中受益。對於C程序員或沒有太多模板經驗的C++程序員來說,TBB也非常容易上手。最重要的是,您不需要有並行編程或多核處理器的經驗來使用本書。

目錄

- 前言
- Intel線程構建塊的首席開發人員的話
- 前言
- 第1章 為什麼使用線程構建塊?
- 第2章 思考並行
- 第3章 基本算法
- 第4章 高級算法