Created
December 10, 2013 06:47
-
-
Save JaDogg/7886666 to your computer and use it in GitHub Desktop.
Run thousand threads !!
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; | |
namespace ThousandThreads | |
{ | |
class Thread1000 | |
{ | |
static void Main(string[] args) | |
{ | |
for (int i = 1; i <=1000; i++) | |
{ | |
var thread = new Thread(MethodOfThread) {Name = "[" + i.ToString("0000") + "]"}; | |
thread.Start(); | |
} | |
} | |
static void MethodOfThread() | |
{ | |
// | |
while (true) | |
{ | |
Console.Write(Thread.CurrentThread.Name); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment