Parallel Programming with Microsoft Visual C Design Patterns for Decomposition and Coordination on Multicore Architectures Patterns and Practices 1st Edition Colin Campbell download
Parallel Programming with Microsoft Visual C Design Patterns for Decomposition and Coordination on Multicore Architectures Patterns and Practices 1st Edition Colin Campbell download
https://ebookultra.com/download/software-modeling-and-design-uml-use-
cases-patterns-and-software-architectures-1st-edition-hassan-gomaa/
https://ebookultra.com/download/pro-objective-c-design-patterns-for-
ios-1st-edition-carlo-chung-auth/
https://ebookultra.com/download/go-design-patterns-1st-edition-
contreras/
Programming with Microsoft Visual Basic 2012 6th Edition
Diane Zak
https://ebookultra.com/download/programming-with-microsoft-visual-
basic-2012-6th-edition-diane-zak/
https://ebookultra.com/download/winning-design-lego-mindstorms-nxt-
design-patterns-for-fun-and-competition-1st-edition-james-trobaugh/
https://ebookultra.com/download/programming-with-visual-c-concepts-
and-projects-1st-edition-james-allert/
https://ebookultra.com/download/design-patterns-1st-edition-
christopher-g-lasater/
https://ebookultra.com/download/android-design-patterns-and-best-
practice-1st-edition-kyle-mew/
Parallel Programming with Microsoft Visual C Design
Patterns for Decomposition and Coordination on
Multicore Architectures Patterns and Practices 1st
Edition Colin Campbell Digital Instant Download
Author(s): Colin Campbell, Ade Miller
ISBN(s): 9780735651753, 0735651752
Edition: 1
File Details: PDF, 3.89 MB
Year: 2011
Language: english
PARALLEL
PROGRAM M ING
WITH
MICROSOFT
V I S U A L C++
Design Patterns for
Decomposition and Coordination
on Multicore Architectures
Colin Campbell
Ade Miller
Forewords by
Tony Hey
Herb Sutter
• • • • • •
• • • • • • • •
• • • • • • •
• • • • •
parallel programming with microsoft visual c++ ®
Parallel Programming
with Microsoft Visual
C++ ®
Colin Campbell
Ade Miller
ISBN 978-0-7356-5175-3
This document is provided “as-is.” Information and views expressed in this
document, including URL and other Internet website references, may change
without notice. You bear the risk of using it. Unless otherwise noted, the
companies, organizations, products, domain names, email addresses, logos,
people, places, and events depicted in examples herein are fictitious. No
association with any real company, organization, product, domain name, email
address, logo, person, place, or event is intended or should be inferred. Comply-
ing with all applicable copyright laws is the responsibility of the user. Without
limiting the rights under copyright, no part of this document may be reproduced,
stored in or introduced into a retrieval system, or transmitted in any form or by
any means (electronic, mechanical, photocopying, recording, or otherwise), or for
any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or
other intellectual property rights covering subject matter in this document.
Except as expressly provided in any written license agreement from Microsoft,
the furnishing of this document does not give you any license to these patents,
trademarks, copyrights, or other intellectual property.
© 2011 Microsoft Corporation. All rights reserved.
Microsoft, MSDN, Visual Basic, Visual C++, Visual C#, Visual Studio, Windows,
Windows Live, Windows Server, and Windows Vista are trademarks of the
Microsoft group of companies.
All other trademarks are property of their respective owners.
Contents
foreword xi
Tony Hey
foreword xiii
Herb Sutter
preface xv
Who This Book Is For xv
Why This Book Is Pertinent Now xvi
What You Need to Use the Code xvi
How to Use This Book xvii
Introduction xviii
Parallelism with Control Dependencies Only xviii
Parallelism with Control and Data
Dependencies xviii
Dynamic Task Parallelism and Pipelines xviii
Supporting Material xix
What Is Not Covered xx
Goals xx
acknowledgments xxi
1 Introduction 1
The Importance of Potential Parallelism 2
Decomposition, Coordination, and Scalable Sharing 3
Understanding Tasks 3
Coordinating Tasks 4
Scalable Sharing of Data 5
Design Approaches 6
Selecting the Right Pattern 7
A Word about Terminology 8
The Limits of Parallelism 8
A Few Tips 10
Exercises 11
For More Information 11
vi
2 Parallel Loops 13
The Basics 14
Parallel for Loops 14
parallel_for_each 15
What to Expect 16
An Example 17
Sequential Credit Review Example 18
Credit Review Example Using
parallel_for_each 18
Performance Comparison 19
Variations 19
Breaking out of Loops Early 19
Exception Handling 20
Special Handling of Small Loop Bodies 21
Controlling the Degree of Parallelism 22
Anti-Patterns 23
Hidden Loop Body Dependencies 23
Small Loop Bodies with Few Iterations 23
Duplicates in the Input Enumeration 23
Scheduling Interactions with
Cooperative Blocking 24
Related Patterns 24
Exercises 24
Further Reading 25
3 Parallel Tasks 27
The Basics 28
An Example 29
Variations 31
Coordinating Tasks with Cooperative Blocking 31
Canceling a Task Group 33
Handling Exceptions 35
Speculative Execution 36
Anti-Patterns 37
Variables Captured by Closures 37
Unintended Propagation of Cancellation Requests 38
The Cost of Synchronization 39
Design Notes 39
Task Group Calling Conventions 39
Tasks and Threads 40
How Tasks Are Scheduled 40
Structured Task Groups and Task Handles 41
Lightweight Tasks 41
Exercises 42
Further Reading 42
vii
4 Parallel Aggregation 45
The Basics 46
An Example 49
Variations 55
Considerations for Small Loop Bodies 55
Other Uses for Combinable Objects 55
Design Notes 55
Related Patterns 57
Exercises 58
Further Reading 58
5 Futures 61
The Basics 62
Futures 63
Example: The Adatum Financial Dashboard 65
The Business Objects 66
The Analysis Engine 67
Variations 70
Canceling Futures 70
Removing Bottlenecks 70
Modifying the Graph at Run Time 71
Design Notes 72
Decomposition into Futures 72
Functional Style 72
Related Patterns 72
Pipeline Pattern 73
Master/Worker Pattern 73
Dynamic Task Parallelism Pattern 73
Discrete Event Pattern 73
Exercises 73
7 Pipelines 85
Types of Messaging Blocks 86
The Basics 86
viii
An Example 92
Sequential Image Processing 92
The Image Pipeline 94
Performance Characteristics 96
Variations 97
Asynchronous Pipelines 97
Canceling a Pipeline 101
Handling Pipeline Exceptions 102
Load Balancing Using Multiple Producers 104
Pipelines and Streams 106
Anti-Patterns 107
Copying Large Amounts of Data between
Pipeline Stages 107
Pipeline Stages that Are Too Small 107
Forgetting to Use Message Passing for Isolation 107
Infinite Waits 107
Unbounded Queue Growth 107
More Information 107
Design Notes 108
Related Patterns 109
Exercises 109
Further Reading 109
appendices
glossary 153
index
Foreword
xi
xii for ewor d
Tony Hey
Corporate Vice President, Microsoft Research
Foreword
xiii
xiv
Herb Sutter
Principal Architect, Microsoft
Bellevue, WA, USA
February 2011
Random documents with unrelated
content Scribd suggests to you:
The Project Gutenberg eBook of Lapin
muisteluksia
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.
Language: Finnish
LAPIN MUISTELUKSIA
Kirj.
SAMULI PAULAHARJU
Kansanrunosta.
SISÄLLYS
Alkusana
Lapinkorven valtauksesta
Majava ja peura
Lappalaismuisteluksia Unarilta
Alakylän ensimmäiset asukkaat
Sieppijärvi
Kelontekemä
Lapin-Kyröt
Peräpohjan viimeisiä porolappalaisia
Lapinkodalla
Porolappalainen muuttoretkellä
Poronvarkaus
Joikaaminen
Lapin suurnoitia
Loma-Tuokko
Seitapalvonnan muistoja
Salkko-Niila
Maahiaisista
Saivo ja kaltio
Taivaanvalkiat
Vanhan lapinkirkon tarina
Koutokeino
Akamella ja Kurjenpolvi
Sana- ja asiaselityksiä
Viitteet
Alkusana
Samuli Paulaharju.
LAPINKORVEN VALTAUKSESTA
— Sie olet niin ryöttä! Mie ajan sinut pois ja panen tänne toisen
miehen.
— Niin ne kullit.
Niin teki sitten metsäkin, puhdas metsä, jumalan luoma, sen, ettei
enää suonut parasta riistaansa kelvottomille pyytömiehille.
*****
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com