PacktLib: C# 2008 and 2005 Threaded Programming: Beginner's Guide

C# 2008 and 2005 Threaded Programming

Credits

About the Author

Acknowledgement

About the Reviewers

Preface

Taking Advantage of Multiprocessing and Multiple Cores

Mono-processor systems: The old gladiators

The performance waterfall

Multi-processor systems: Many warriors to win a battle

Summary

Processes and Threads

Processes—any running program

Threads—Independent parts of a process

Summary

BackgroundWorker—Putting Threads to Work

RTC: Rapid thread creation

Asynchronous execution

Synchronous execution

Showing the progress

Cancelling the job

Working with multiple BackgroundWorker components

BackgroundWorker and Timer

BackgroundWorker creation on the fly

Summary

Thread Class—Practical Multithreading in Applications

Creating threads with the Thread class

Sharing data between threads

Passing parameters to threads

Summary

Simple Debugging Techniques with Multithreading

Watching multiple threads

Debugging multithreaded applications as single-threaded applications

Showing partial results in multithreaded code

Summary

Understanding Thread Control with Patterns

Starting, joining, pausing, and restarting threads

Understanding the pixels' color compositions

Creating independent blocks of concurrent code

Summary

Dynamically Splitting Jobs into Pieces—Avoiding Problems

Running split jobs many times

Generalizing the algorithms for segmentation with classes

Summary

Simplifying Parallelism Complexity

Specializing the algorithms for segmentation with classes

Avoiding locks and many synchronization nightmares

Summary

Working with Parallelized Input/Output and Data Access

Queuing threads with I/O operations

Parallelizing database access

Summary

Parallelizing and Concurrently Updating the User Interface

Updating the UI from independent threads

Reporting progress to the UI from independent threads

Summary

Coding with .NET Parallel Extensions

Parallelizing loops using .NET extensions

Parallelizing queries

Summary

Developing a Completely Parallelized Application

Joining many different parallelized pieces into a complete application

Rationalizing multithreaded code

Summary

Index