C#
Multithreaded ProgrammingC# - Multithreaded Programming
Threading Basics
Threads and Multitasking
Context Switching
A Multithreaded Application in C#
Working with Threads
AppDomain
The Thread Class
Creating Threads and Thread Objects
Managing Thread Lifetimes
Destroying Threads
Scheduling Threads
Thread Safety and Synchronization
Protecting Code by Using the Monitor Class
Using Monitor Locks with the C# lock Statement
Synchronizing Code by Using the Mutex Class
Thread Safety and the .NET Classes
Threading Guidelines
When to Use Threads
Increased Concurrency
Simplified Design
Better Utilization of CPU Time
When Not to Use Threads
Costs Outweigh Benefits
You Haven't Benchmarked Both Cases
No Good Reason Why You Should
Summary
Technically speaking, threads are not specific to C#; most C# books tend to stay away from the topic for that reason. Although I've tried to stay very specific to C#, the general subject of multithreading is one most programmers should be familiar with when learning this new language. I certainly can't cover the entire range of threading-related issues in one tutorial, but I will cover the basics and even some intermediate-to-advanced issues regarding the aborting, scheduling, and lifetime management of threads. I'll also discuss thread synchronization with the System.Monitor and System.Mutex classes and the C# lock statement.