close menu
Bookswagon-24x7 online bookstore
close menu
My Account
Professional Parallel Programming with C#: Master Parallel Extensions with .NET 4

Professional Parallel Programming with C#: Master Parallel Extensions with .NET 4

          
5
4
3
2
1

Out of Stock


Premium quality
Premium quality
Bookswagon upholds the quality by delivering untarnished books. Quality, services and satisfaction are everything for us!
Easy Return
Easy return
Not satisfied with this product! Keep it in original condition and packaging to avail easy return policy.
Certified product
Certified product
First impression is the last impression! Address the book’s certification page, ISBN, publisher’s name, copyright page and print quality.
Secure Checkout
Secure checkout
Security at its finest! Login, browse, purchase and pay, every step is safe and secured.
Money back guarantee
Money-back guarantee:
It’s all about customers! For any kind of bad experience with the product, get your actual amount back after returning the product.
On time delivery
On-time delivery
At your doorstep on time! Get this book delivered without any delay.
Notify me when this book is in stock
Add to Wishlist

About the Book

Expert guidance for those programming today’s dual-core processors PCs

As PC processors explode from one or two to now eight processors, there is an urgent need for programmers to master concurrent programming. This book dives deep into the latest technologies available to programmers for creating professional parallel applications using C#, .NET 4, and Visual Studio 2010. The book covers task-based programming, coordination data structures, PLINQ, thread pools, asynchronous programming model, and more. It also teaches other parallel programming techniques, such as SIMD and vectorization.

  • Teaches programmers professional-level, task-based, parallel programming with C#, .NET 4, and Visual Studio 2010
  • Covers concurrent collections, coordinated data structures, PLINQ, thread pools, asynchronous programming model, Visual Studio 2010 debugging, and parallel testing and tuning
  • Explores vectorization, SIMD instructions, and additional parallel libraries

Master the tools and technology you need to develop thread-safe concurrent applications for multi-core systems, with Professional Parallel Programming with C#.



Table of Contents:

FOREWORD xix

INTRODUCTION xxi

CHAPTER 1: TASK-BASED PROGRAMMING 1

Working with Shared-Memory Multicore 2

Differences Between Shared-Memory Multicore and Distributed-Memory Systems 3

Parallel Programming and Multicore Programming 4

Understanding Hardware Threads and Software Threads 5

Understanding Amdahl’s Law 10

Considering Gustafson’s Law 13

Working with Lightweight Concurrency 16

Creating Successful Task-Based Designs 17

Designing With Concurrency in Mind 18

Understanding the Differences between Interleaved Concurrency, Concurrency, and Parallelism 19

Parallelizing Tasks 19

Minimizing Critical Sections 21

Understanding Rules for Parallel Programming for Multicore 22

Preparing for NUMA and Higher Scalability 22

Deciding the Convenience of Going Parallel 27

Summary 28

CHAPTER 2: IMPERATIVE DATA PARALLELISM 29

Launching Parallel Tasks 30

System.Threading.Tasks.Parallel Class 31

Parallel.Invoke 32

No Specific Execution Order 33

Advantages and Trade-Off s 37

Interleaved Concurrency and Concurrency 38

Transforming Sequential Code to Parallel Code 40

Detecting Parallelizable Hotspots 40

Measuring Speedups Achieved by Parallel Execution 43

Understanding the Concurrent Execution 45

Parallelizing Loops 45

Parallel.For 46

Refactoring an Existing Sequential Loop 48

Measuring Scalability 50

Working with Embarrassingly Parallel Problems 52

Parallel.ForEach 52

Working with Partitions in a Parallel Loop 54

Optimizing the Partitions According to the Number of Cores 56

Working with IEnumerable Sources of Data 58

Exiting from Parallel Loops 60

Understanding ParallelLoopState 62

Analyzing the Results of a Parallel Loop Execution 63

Catching Exceptions that Occur Inside Parallel Loops 64

Specifying the Desired Degree of Parallelism 66

ParallelOptions 66

Counting Hardware Threads 69

Logical Cores Aren’t Physical Cores 70

Using Gantt Charts to Detect Critical Sections 71

Summary 72

CHAPTER 3: IMPERATIVE TASK PARALLELISM 73

Creating and Managing Tasks 74

System.Theading.Tasks.Task 75

Understanding a Task’s Status and Lifecycle 77

TaskStatus: Initial States 77

TaskStatus: Final States 78

Using Tasks to Parallelize Code 78

Starting Tasks 79

Visualizing Tasks Using Parallel Tasks and Parallel Stacks 80

Waiting for Tasks to Finish 85

Forgetting About Complex Threads 85

Cancelling Tasks Using Tokens 86

CancellationTokenSource 89

CancellationToken 89

TaskFactory 90

Handling Exceptions Thrown by Tasks 91

Returning Values from Tasks 92

TaskCreationOptions 95

Chaining Multiple Tasks Using Continuations 95

Mixing Parallel and Sequential Code with Continuations 97

Working with Complex Continuations 97

TaskContinuationOptions 98

Programming Complex Parallel Algorithms with Critical Sections Using Tasks 100

Preparing the Code for Concurrency and Parallelism 101

Summary 101

CHAPTER 4: CONCURRENT COLLECTIONS 103

Understanding the Features Offered by Concurrent Collections 104

System.Collections.Concurrent 107

ConcurrentQueue 107

Understanding a Parallel Producer-Consumer Pattern 111

Working with Multiple Producers and Consumers 115

Designing Pipelines by Using Concurrent Collections 120

ConcurrentStack 121

Transforming Arrays and Unsafe Collections into

Concurrent Collections 128

ConcurrentBag 129

IProducerConsumerCollection 136

BlockingCollection 137

Cancelling Operations on a BlockingCollection 142

Implementing a Filtering Pipeline with Many BlockingCollection Instances 144

ConcurrentDictionary 150

Summary 155

CHAPTER 5: COORDINATION DATA STRUCTURES 157

Using Cars and Lanes to Understand the Concurrency Nightmares 158

Undesired Side Effects 158

Race Conditions 159

Deadlocks 160

A Lock-Free Algorithm with Atomic Operations 161

A Lock-Free Algorithm with Local Storage 162

Understanding New Synchronization Mechanisms 163

Working with Synchronization Primitives 164

Synchronizing Concurrent Tasks with Barriers 165

Barrier and ContinueWhenAll 171

Catching Exceptions in all Participating Tasks 172

Working with Timeouts 173

Working with a Dynamic Number of Participants 178

Working with Mutual-Exclusion Locks 179

Working with Monitor 182

Working with Timeouts for Locks 184

Refactoring Code to Avoid Locks 187

Using Spin Locks as Mutual-Exclusion Lock Primitives 190

Working with Timeouts 193

Working with Spin-Based Waiting 194

Spinning and Yielding 197

Using the Volatile Modifier 200

Working with Lightweight Manual Reset Events 201

Working with ManualResetEventSlim to Spin and Wait 201

Working with Timeouts and Cancellations 206

Working with ManualResetEvent 210

Limiting Concurrency to Access a Resource 211

Working with SemaphoreSlim 212

Working with Timeouts and Cancellations 216

Working with Semaphore 216

Simplifying Dynamic Fork and Join Scenarios with CountdownEvent 219

Working with Atomic Operations 223

Summary 228

CHAPTER 6: PLINQ: DECLARATIVE DATA PARALLELISM 229

Transforming LINQ into PLINQ 230

ParallelEnumerable and Its AsParallel Method 232

AsOrdered and the orderby Clause 233

Specifying the Execution Mode 237

Understanding Partitioning in PLINQ 237

Performing Reduction Operations with PLINQ 242

Creating Custom PLINQ Aggregate Functions 245

Concurrent PLINQ Tasks 249

Cancelling PLINQ 253

Specifying the Desired Degree of Parallelism 255

WithDegreeOfParallelism 255

Measuring Scalability 257

Working with ForAll 259

Differences Between foreach and ForAll 261

Measuring Scalability 261

Configuring How Results Are Returned by Using WithMergeOptions 264

Handling Exceptions Thrown by PLINQ 266

Using PLINQ to Execute MapReduce Algorithms 268

Designing Serial Stages Using PLINQ 271

Locating Processing Bottlenecks 273

Summary 273

CHAPTER 7: VISUAL STUDIO 2010 TASK DEBUGGING CAPABILITIES 275

Taking Advantage of Multi-Monitor Support 275

Understanding the Parallel Tasks Debugger Window 279

Viewing the Parallel Stacks Diagram 286

Following the Concurrent Code 294

Debugging Anonymous Methods 304

Viewing Methods 305

Viewing Threads in the

Source Code 307

Detecting Deadlocks 310

Summary 316

CHAPTER 8: THREAD POOLS 317

Going Downstairs from the Tasks Floor 317

Understanding the New CLR 4 Thread Pool Engine 319

Understanding Global Queues 319

Waiting for Worker Threads to Finish Their Work 329

Tracking a Dynamic Number of Worker Threads 336

Using Tasks Instead of Threads to Queue Jobs 340

Understanding the Relationship Between Tasks and the Thread Pool 343

Understanding Local Queues and the Work-Stealing Algorithm 347

Specifying a Custom Task Scheduler 353

Summary 359

CHAPTER 9: ASYNCHRONOUS PROGRAMMING MODEL 361

Mixing Asynchronous Programming with Tasks 362

Working with TaskFactory.FromAsync 363

Programming Continuations After Asynchronous Methods End 368

Combining Results from Multiple Concurrent Asynchronous Operations 369

Performing Asynchronous WPF UI Updates 371

Performing Asynchronous Windows Forms UI Updates 379

Creating Tasks that Perform EAP Operations 385

Working with TaskCompletionSource 394

Summary 398

CHAPTER 10: PARALLEL TESTING AND TUNING 399

Preparing Parallel Tests 399

Working with Performance Profi ling Features 404

Measuring Concurrency 406

Solutions to Common Patterns 416

Serialized Execution 416

Lock Contention 419

Lock Convoys 420

Oversubscription 423

Undersubscription 426

Partitioning Problems 428

Workstation Garbage-Collection Overhead 431

Working with the Server Garbage Collector 434

I/O Bottlenecks 434

Main Thread Overload 435

Understanding False Sharing 438

Summary 441

CHAPTER 11: VECTORIZATION, SIMD INSTRUCTIONS, AND ADDITIONAL PARALLEL LIBRARIES 443

Understanding SIMD and Vectorization 443

From MMX to SSE4.x and AVX 446

Using the Intel Math Kernel Library 447

Working with Multicore-Ready, Highly Optimized Software Functions 455

Mixing Task-Based Programming with External Optimized Libraries 456

Generating Pseudo-Random Numbers in Parallel 457

Using Intel Integrated Performance Primitives 461

Summary 468

APPENDIX A: .NET 4 PARALLELISM CLASS DIAGRAMS 469

Task Parallel Library 469

System.Threading.Tasks.Parallel Classes and Structures 469

Task Classes, Enumerations, and Exceptions 471

Data Structures for Coordination in Parallel Programming 472

Concurrent Collection Classes: System.Collections.Concurrent 474

Lightweight Synchronization Primitives 476

Lazy Initialization Classes 477

PLINQ 477

Threading 479

Thread and ThreadPool Classes and Their Exceptions 479

Signaling Classes 479

Threading Structures, Delegates, and Enumerations 480

BackgroundWorker Component 486

APPENDIX B: CONCURRENT UML MODELS 487

Structure Diagrams 487

Class Diagram 487

Component Diagram 489

Deployment Diagram 489

Package Diagram 489

Behavior Diagrams 489

Activity Diagram 491

Use Case Diagram 491

Interaction Diagrams 493

Interaction Overview Diagram 493

Sequence Diagram 494

APPENDIX C: PARALLEL EXTENSIONS EXTRAS 497

Inspecting Parallel Extensions Extras 497

Coordination Data Structures 502

Extensions 507

Parallel Algorithms 513

Partitioners 516

Task Schedulers 517

INDEX 521


Best Seller

| | See All

Product Details
  • ISBN-13: 9781118029787
  • Publisher: John Wiley & Sons Inc
  • Publisher Imprint: Wrox Press
  • Language: English
  • Sub Title: Master Parallel Extensions with .NET 4
  • ISBN-10: 111802978X
  • Publisher Date: 08 Dec 2010
  • Binding: Digital (delivered electronically)
  • No of Pages: 520


Similar Products

How would you rate your experience shopping for books on Bookswagon?

Add Photo
Add Photo

Customer Reviews

REVIEWS           
Be The First to Review
Professional Parallel Programming with C#: Master Parallel Extensions with .NET 4
John Wiley & Sons Inc -
Professional Parallel Programming with C#: Master Parallel Extensions with .NET 4
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Professional Parallel Programming with C#: Master Parallel Extensions with .NET 4

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book
    Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals

    | | See All


    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!
    ASK VIDYA