Created
May 5, 2013 16:37
-
-
Save huanlin/5521331 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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