Threading in C#
Threading can boost the performance of application if used wisely. In this tutorial I will show you how to create thread in C#.net. This is very simple application for beginners. System.Threading is the namespace used for Type thread in C#.
static void Main(string args)
Thread t1 = new Thread( MethodA );
Console.WriteLine("This is main thread.");
static void MethodA()
Console.WriteLine("Thread Method A");
Output of Simple Threading application in C#
This is main thread.
Thread Method A
The program creates simple tread in C#. Instance of Thread accepts method to execute when thread start. Join method of thread instance blocks exit of main thread till thread t1 get finished.