using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace ConsoleApplication6
{
class Program
{
public static int Count = 0;
static void MyThread( )
{
for (int i = 0; i < 1000000; i++)
{
Count++;
Count--;
}
}
static void Main(string[] args)
{
Thread T1 = new Thread(new ThreadStart(MyThread));
Thread T2 = new Thread(new ThreadStart(MyThread));
Thread T3 = new Thread(new ThreadStart(MyThread));
Thread T4 = new Thread(new ThreadStart(MyThread));
T1.Start();
T2.Start();
T3.Start();
T4.Start();
Console.WriteLine("count = " + Count);
Console.Read();
}
}
}