Intel Threading Building Blocks: Outfitting C++ for Multi-core Processor Parallelism (Paperback)
暫譯: Intel 執行緒建構模組:為 C++ 配備多核心處理器的平行運算
James Reinders
買這商品的人也買了...
-
$860$679 -
$720$569 -
$2,040$1,938 -
$780$663 -
$350$277 -
$880$695 -
$650$514 -
$1,920$1,824 -
$550$468 -
$980$774 -
$500$450 -
$480$379 -
$1,200$948 -
$580$493 -
$880$695 -
$360$342 -
$990$891 -
$350$298 -
$600$468 -
$600$480 -
$720$612 -
$1,200$1,020 -
$1,800$1,764 -
$199$157 -
$650$507
相關主題
商品描述
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: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.
- 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
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
商品描述(中文翻譯)
**描述**
來自 Intel 和 AMD 的多核心晶片提供了顯著的速度和響應提升,並為普通桌面電腦提供了許多多處理的機會。但它們也帶來了一個挑戰:多執行緒比以往任何時候都更成為良好性能的必要條件。本指南解釋了如何通過一個可攜式的 C++ 函式庫來最大化這些處理器的優勢,該函式庫可在 Windows、Linux、Macintosh 和 Unix 系統上運行。透過這本書,您將學會如何有效地使用 Intel Threading Building Blocks (TBB) 進行平行程式設計,而無需成為執行緒專家。
本書由 Intel 軟體產品的首席傳道者 James Reinders 撰寫,基於 Intel 開發人員和客戶的經驗,解釋了多執行緒中的關鍵任務以及如何以可攜式和穩健的方式使用 TBB 來完成這些任務。書中提供了大量範例和完整的參考資料,列出了常見的使用模式,揭示了 TBB 中的陷阱,並提供了在選擇替代方案時獲得最佳性能的重要指導。
您將學到 Intel Threading Building Blocks 的以下內容:
- 使您能夠指定任務而不是執行緒,以獲得更好的可攜性、更簡單的程式設計、更易於理解的源代碼,以及更好的性能和可擴展性。
- 專注於平行化計算密集型工作的目標,以提供高層次的解決方案。
- 與其他執行緒套件相容,並不強迫您為整個程式選擇一個套件。
- 強調可擴展的數據平行程式設計,這使得隨著處理器的增加,程式性能得以提升。
- 依賴於泛型程式設計,使您能夠在最少的約束下編寫最佳的演算法。
任何希望在多核心系統上編寫應用程式的 C++ 程式設計師都將從這本書中受益。對於沒有太多模板經驗的 C 程式設計師或 C++ 程式設計師來說,TBB 也非常易於接觸。最重要的是,您不需要具備平行程式設計或多核心處理器的經驗即可使用本書。
**目錄**
- 前言
- Intel Threading Building Blocks 首席開發者的註解
- 序言
- 1. 為什麼選擇 Threading Building Blocks?
- 概述
- 優勢
- 2. 平行思考
- 平行思考的要素
- 分解
- 擴展與加速
- 什麼是執行緒?
- 互斥與鎖
- 正確性
- 抽象
- 模式
- 直覺
- 3. 基本演算法
- 初始化與終止函式庫
- 迴圈平行化
- 遞迴範圍規範
- 迴圈摘要
- 4. 進階演算法
- 流的平行演算法
- 5. 容器
- concurrent_queue
- concurrent_vector
- concurrent_hash_map
- 6. 可擴展的記憶體分配
- 限制
- 記憶體分配中的問題
- 記憶體分配器
- 替換 malloc、new 和 delete
- 7. 互斥
- 何時使用互斥
- 互斥鎖
- 原子操作
- 8. 計時
- 9. 任務排程器
- 何時不適合使用基於任務的程式設計
- 比原生執行緒好得多
- 初始化函式庫是您的工作
- 費波那契數的範例程式
- 任務排程概述
- 任務排程的運作方式
- 推薦的任務重複模式
- 最佳利用排程器
- 任務排程器介面
- 任務排程器摘要
- 10. 成功的關鍵
- 成功的關鍵步驟
- 放鬆的順序執行
- 方法和函式庫的安全並行性
- 除錯與發佈
- 為了效率
- 啟用除錯功能
- 與其他執行緒套件混合
- 命名慣例
- 11. 範例
- Aha! 因素
- 其他幾個關鍵點
- parallel_for 範例
- 生命遊戲
- parallel_reduce 範例
- CountStrings:使用 concurrent_hash_map
- Quicksort:可視化任務竊取
- 更好的矩陣乘法 (Strassen)
- 進階任務程式設計
- 封包處理管道
- 記憶體分配
- 遊戲執行緒範例
- 物理互動與更新代碼
- 開放動力引擎
- 12. 歷史與相關專案
- 函式庫
- 語言
- 實用指令
- 泛型程式設計
- 快取
- 時間切片的成本
- Lambda 函數簡介
- 進一步閱讀
- 索引