티스토리 뷰
// C# 1.0 Style Thread
using System;
using System.Threading;
namespace ThreadSample
{
class Program
{
static void Main(string[] args)
{
// C# 1.0 Style Thread uses ThreadStart
ThreadStart ts = new ThreadStart(Work);
Thread t1 = new Thread(ts);
t1.Start();
for (int count = 0; count < Repetitions; count++)
{
Console.Write('@');
}
}
static void Work()
{
for (int count = 0; count < Repetitions; count++)
{
Console.Write('.');
}
}
const int Repetitions = 1000;
}
}
'Ongoing > Thread' 카테고리의 다른 글
Thread [Java] implements Runnable (0) | 2018.07.16 |
---|---|
Thread [C#] C# 2.0 Style Thread without ThreadStart (0) | 2018.07.16 |