Here is the listing of C# programming examples on Threads.
1. C# Examples on Basics of Thread
A thread is a path in the execution of a process. It contains a Program counter, a thread ID, a stack and a set of registers. Thread Pool is a group of threads that are waiting ready to be given work. Killing a thread means forcing the referenced thread to terminate. sleep() method is used to pause a running thread. The following programs demonstrate the creation of a thread, thread pool, pausing the execution of a running thread, illustrating a thread lock and killing a thread.
C# Program to Create a Simple Thread
C# Program to Create Thread Pools
C# Program to Pause a Thread
C# Program to Demonstrate Lock in Thread
C# Program to Kill a Thread
2. C# Examples on the Methods that are Implemented on Thread
The following programs gives the name of the thread that is currently executing, displays the thread priority – It determines which thread is to be called next for execution. Name property of the thread gets or sets the name of the thread. The sleep() method of the thread makes the thread to sleep for a specified period of time. The following programs displays the context id of a thread, demonstrates the name property and sleep method of a thread and obtains the status of a thread. It determines if the thread is in new, runnable, waiting, blocked and terminated state.