Building Multithreaded Applications
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| CSharp-Online.NET:Articles |
| C# Articles |
|
Building Multithreaded Apps |
| © 2005 Andrew Troelsen |
| This article—Building Multithreaded Applications—is from Pro C# 2005 and the .NET 2.0 Platform, 3rd edition, by Andrew Troelsen. Copyright © 2005 Andrew Troelsen. All rights reserved. Reproduced by permission. This article has been edited especially for C# Online.NET. Read the book review! |
|
Building Multithreaded Applications
In the previous chapter, you examined the relationship between processes, application domains, and contexts. This chapter builds on your newfound knowledge by examining how the .NET platform allows you to build multithreaded applications and how to keep shared resources thread-safe.
You’ll begin by revisiting the .NET delegate type and come to understand its intrinsic support for asynchronous method invocations. As you’ll see, this technique allows you to invoke a method on a secondary thread of execution automatically. Next, you’ll investigate the types within the System.Threading namespace. Here you’ll examine numerous types (Thread, ThreadStart, etc.) that allow you to easily create additional threads of execution. Of course, the complexity of multithreaded development isn’t in the creation of threads, but in ensuring that your code base is well equipped to handle concurrent access to shared resources. Given this, the chapter closes by examining various synchronization primitives that the .NET Framework provides.
|


