Skip to content

Instantly share code, notes, and snippets.

@huanlin
Created May 5, 2013 16:37
Show Gist options
  • Save huanlin/5521331 to your computer and use it in GitHub Desktop.
Save huanlin/5521331 to your computer and use it in GitHub Desktop.
using System;
using System.Threading;
class Program
{
static void Main(string[] args)
{
Thread t1 = new Thread(MyBackgroundTask);
Thread t2 = new Thread(MyBackgroundTask);
Thread t3 = new Thread(MyBackgroundTask);
t1.Start("X");
t2.Start("Y");
t3.Start("Z");
for (int i = 0; i < 500; i++)
{
Console.Write(".");
}
}
static void MyBackgroundTask(object param)
{
for (int i = 0; i < 500; i++)
{
Console.Write(param);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment