An error occured adding a product to your cart, you may only have 100 items in your cart.

C# Multithreaded and Parallel Programming

Develop powerful C# applications to take advantage of today's multicore hardware
Preview in Mapt

C# Multithreaded and Parallel Programming

Rodney Ringler

1 customer reviews
Develop powerful C# applications to take advantage of today's multicore hardware

Quick links: > What will you learn?> Table of content> Product reviews

Mapt Subscription
FREE
£24.99/m after trial
eBook
£15.96
RRP £22.78
Save 29%
Print + eBook
£30.99
RRP £30.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
£0.00
£15.96
£30.99
£25.00 p/m after trial
RRP £22.78
RRP £30.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


C# Multithreaded and Parallel Programming Book Cover
C# Multithreaded and Parallel Programming
£ 22.78
£ 15.96
Multithreading in C# 5.0 Cookbook Book Cover
Multithreading in C# 5.0 Cookbook
£ 22.78
£ 15.96
Buy 2 for £31.68
Save £11.58
Add to Cart

Book Details

ISBN 139781849688321
Paperback344 pages

Book Description

Most modern machines have dual-core processors. This means that the present-day computer has the ability to multitask. Using multiple cores means your applications can process data faster and be more responsive to users. However, to fully exploit this in your applications, you need to write multithreading code.

We will begin by covering some techniques that have been around since the beginning of .NET, including the BackgroundWorker component, timers, and the Thread class. We will use tasks, task factories, and parallel loops to develop multithreaded applications at a higher level than directly creating and managing individual threads. Finally, we will look at the tools Visual Studio provides for debugging parallel applications, common concurrent design patterns, and the latest updates in PLINQ and async.

Table of Contents

Chapter 1: Understanding Multiprocessing and Multiple Cores
Mono-processor systems – the old gladiators
Multiprocessor systems – many warriors to win a battle
Multiple core processors and hyperthreading
Examining our hardware
OS scheduler operations
Designing for concurrency
Summary
Chapter 2: Looking at Multithreaded Classes – BackgroundWorker
Getting started with the BackgroundWorker component
Simple example without a BackgroundWorker object
WPF example with an asynchronous BackgroundWorker
WPF example with a synchronous BackgroundWorker
Showing progress
Canceling a BackgroundWorker thread
Working with multiple BackgroundWorker components
Exploring other examples
Summary
Chapter 3: Thread Class – Heavyweight Concurrency in C#
Creating threads with the Thread class
Creating an application with threads
Sharing data between threads
Passing parameters to threads
Summary
Chapter 4: Advanced Thread Processing
Pipelining
Pausing and restarting threads
Signals between threads
Joining threads
Locking resources to ensure thread-safe data
Error handling with threads
Summary
Chapter 5: Lightweight Concurrency – Task Parallel Library (TPL)
Task Parallel Library
Exploring tasks
Tasks with return values
Concurrent collections
Exploring the TaskFactory class
Task schedulers
Introducing the Parallel class
Delegates and lambda expressions
Summary
Chapter 6: Task-based Parallelism
Waiting for a task to complete
Waiting for multiple tasks to complete
Canceling a task
Task exception handling
Summary
Chapter 7: Data Parallelism
Parallel loop processing
Data parallelism on collections using Parallel.ForEach
Canceling a parallel loop
Handling exceptions in parallel loops
Using thread-local variables in parallel loops
Summary
Chapter 8: Debugging Multithreaded Applications with Visual Studio
Considerations for debugging multithreaded applications
Using the Threads window
Using the Tasks window
Using the Parallel Stacks window
Using the Parallel Watch window
Debugging an entire application
Summary
Chapter 9: Pipeline and Producer-consumer Design Patterns
Pipeline design pattern
Explaining message blocks
Producer-consumer design pattern
Summary
Chapter 10: Parallel LINQ – PLINQ
Executing a PLINQ
Ordering in PLINQ
Merging in PLINQ
Canceling a PLINQ
Understanding performance improvements in PLINQ
Summary
Chapter 11: The Asynchronous Programming Model
Introduction to the Asynchronous Programming Model
Using an AsyncCallback delegate method
The async and await keywords
Summary

What You Will Learn

  • Explore all the essential methods used for programming multithreaded applications
  • Enhance the performance of an application by designing various parallel operations to achieve concurrency
  • Build powerful applications using the Task Parallel Library (TPL), which makes concurrent processing of items in a data collection simple
  • Implement data parallelism using the Parallel library, concurrent collections, and PLINQ
  • Debug your multithreaded applications using the Threads view, Tasks window, Parallel Stacks window, and Parallel Watch window
  • Accomplish any given parallel task using two of the most popular parallel patterns for development: Pipelining and producer-consumer
  • Get to grips with the Asynchronous Programming Model (APM) to learn to begin and end asynchronous operations

Authors

Table of Contents

Chapter 1: Understanding Multiprocessing and Multiple Cores
Mono-processor systems – the old gladiators
Multiprocessor systems – many warriors to win a battle
Multiple core processors and hyperthreading
Examining our hardware
OS scheduler operations
Designing for concurrency
Summary
Chapter 2: Looking at Multithreaded Classes – BackgroundWorker
Getting started with the BackgroundWorker component
Simple example without a BackgroundWorker object
WPF example with an asynchronous BackgroundWorker
WPF example with a synchronous BackgroundWorker
Showing progress
Canceling a BackgroundWorker thread
Working with multiple BackgroundWorker components
Exploring other examples
Summary
Chapter 3: Thread Class – Heavyweight Concurrency in C#
Creating threads with the Thread class
Creating an application with threads
Sharing data between threads
Passing parameters to threads
Summary
Chapter 4: Advanced Thread Processing
Pipelining
Pausing and restarting threads
Signals between threads
Joining threads
Locking resources to ensure thread-safe data
Error handling with threads
Summary
Chapter 5: Lightweight Concurrency – Task Parallel Library (TPL)
Task Parallel Library
Exploring tasks
Tasks with return values
Concurrent collections
Exploring the TaskFactory class
Task schedulers
Introducing the Parallel class
Delegates and lambda expressions
Summary
Chapter 6: Task-based Parallelism
Waiting for a task to complete
Waiting for multiple tasks to complete
Canceling a task
Task exception handling
Summary
Chapter 7: Data Parallelism
Parallel loop processing
Data parallelism on collections using Parallel.ForEach
Canceling a parallel loop
Handling exceptions in parallel loops
Using thread-local variables in parallel loops
Summary
Chapter 8: Debugging Multithreaded Applications with Visual Studio
Considerations for debugging multithreaded applications
Using the Threads window
Using the Tasks window
Using the Parallel Stacks window
Using the Parallel Watch window
Debugging an entire application
Summary
Chapter 9: Pipeline and Producer-consumer Design Patterns
Pipeline design pattern
Explaining message blocks
Producer-consumer design pattern
Summary
Chapter 10: Parallel LINQ – PLINQ
Executing a PLINQ
Ordering in PLINQ
Merging in PLINQ
Canceling a PLINQ
Understanding performance improvements in PLINQ
Summary
Chapter 11: The Asynchronous Programming Model
Introduction to the Asynchronous Programming Model
Using an AsyncCallback delegate method
The async and await keywords
Summary

Book Details

ISBN 139781849688321
Paperback344 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Multithreading in C# 5.0 Cookbook Book Cover
Multithreading in C# 5.0 Cookbook
£ 22.78
£ 15.96
GLSL Essentials Book Cover
GLSL Essentials
£ 16.78
£ 11.76
Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C# Book Cover
Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#
£ 20.38
£ 14.28
Creating E-Learning Games with Unity Book Cover
Creating E-Learning Games with Unity
£ 17.98
£ 12.60
SFML Game Development Book Cover
SFML Game Development
£ 20.38
£ 14.28
Raspberry Pi Mechatronics Projects HOTSHOT Book Cover
Raspberry Pi Mechatronics Projects HOTSHOT
£ 20.38
£ 14.28