This section describes the System.Threading.Thread class, which represents an execution thread.
To create and manage an execution thread, you need to use
System.Threading.Thread class, which represents an execution thread.
In .NET 4, System.Threading.Thread class supports these methods and properties:
- Thread(method) - The main constructor to create a new thread with the
execution method specified as ThreadStart delegate.
- CurrentThread - Static property to get the current running thread.
- IsAlive - Property to get a value indicating the execution status of the thread.
- Name - Property to get and set the name of the thread.
- ManagedThreadId - Property to get a unique identifier for the current managed thread.
- Sleep(length) - Static method to suspend the calling thread for the specified milliseconds.
- Start() - Method to start the execution of the thread. The calling thread will continue
its own execution right after the new thread is started.
- Abort() - Method to terminate the thread.
- Join() - Method to block the calling thread until this thread terminates.
Table of Contents
About This Book
Introduction of C# (C Sharp)
Data Type and Variables
Logical Expressions and Conditional Statements
Arrays and Loop Statements
Data Type Features
Floating-Point Data Types
Passing Parameters to Methods
Execution Environment Class
Visual C# 2010 Express Edition
C# Compiler and Intermediate Language
Compiling C# Source Code Files
MSBuild - Microsoft Build Engine
Memory Usages of Processes
►Multithreading in C#
What Is Multithreading?
Creating and Running Threads
Threads to Run Instance Methods
Performance Impact with Multiple Threads
Multi-Thread Programs on Multi-CPU Systems
Maximum Number of Threads in a Program
Async Feature from C# 5
WPF - Windows Presentation Foundation
Partial Classes and Partial Methods
Full Version in PDF/ePUB