How To : Start A Thread

Posted by Naimishforu under C# category on | Points: 40 | Views : 1758
static void BackgroundThreadMethod()
Console.WriteLine("background thread started");
static void Main(string[] args)
//declare threadstart delegate
ThreadStart background = new ThreadStart(BackgroundThreadMethod);
Console.WriteLine("Creating background thread");
//start background thread
Thread t = new Thread(background);
Console.WriteLine("Starting background thread");

Comments or Responses

Login to post response