// csc thread_create_1.cs
using System;
using System.Threading;
namespace ex_threading
{
public class threading
{
// This method that will be called when the thread is started
public static void process_thread()
{
Console.WriteLine ("Thread initiated " + Thread.CurrentThread.Name);
}
}
class test
{
static void Main()
{
Console.WriteLine("Thread create Sample");
Thread.CurrentThread.Name = "main";
Console.WriteLine (" Current Thread : " +
Thread.CurrentThread.Name.ToString());
Thread sub = new Thread (threading.process_thread);
sub.Name = "sub-thread";
sub.Start();
threading.process_thread();
Console.ReadLine();
}
}
}// end of the name space