Book Image

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

By : Gaston C. Hillar
Book Image

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

By: Gaston C. Hillar

Overview of this book

<p>Most modern machines have dual core processors. This means that multitasking is built right into your computer's hardware. Using both cores means your applications can process data faster and be more responsive to users. But to fully exploit this in your applications, you need to write multithreading code, which means learning some challenging new concepts.<br /><br />This book will guide you through everything you need to start writing multithreaded C# applications. You will see how to use processes and threads in C#, .NET Framework features for concurrent programming, sharing memory space between threads, and much more. The book is full of practical, interesting examples and working code.<br /><br />This book begins with the fundamental concepts such as processes, threads, mono-processor systems, multi-processor systems. As the book progresses, the readers get a clear understanding of starting, joining, pausing and restarting threads. The readers get a better understanding of the simple techniques associated with parallelism. There are short exercises at the end of every chapter for the readers to perform.<br /><br />The book also includes several practical parallelism algorithms and data structures used for illustration, and best practices and practical topics like debugging and performance.</p>
Table of Contents (19 chapters)
C# 2008 and 2005 Threaded Programming
Credits
About the Author
Acknowledgement
About the Reviewers
Preface
Index

Summary


We've learned a lot in this chapter about parallelizing the execution of code, taking advantage of the .NET Parallel Extensions. We were able to combine different execution techniques with automatically parallelized structures that will be available in Visual Studio 2010. Specifically, we covered:

  • Downloading and installing .NET Parallel Extensions CTP

  • Combining asynchronous executions with synchronous parallelized loops and other automatically parallelized structures

  • Using delegates to make cross-thread calls, and safely update the user interface from independent tasks scheduled and coordinated by the .NET Parallel Extensions

  • Achieving scalability combining calls to third-party libraries in our parallel algorithms

  • Reducing the code needed to run tasks in parallel using the C# 3.0 lambda expressions

  • Running queries in parallel using PLINQ and multiple LINQ invocations

  • Creating producer-consumer schemes running in multiple threads without synchronization pains

  • Taking advantage of future improvements...