Skip to content

Instantly share code, notes, and snippets.

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