this is my app to excute a threading example, but the output is not as expected , anyone have any clue about that please
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace OTS_Performence_Test_tool
{
class Program
{
static void testThread(string xx)
{
int count = 0;
while (count < 5)
{
Console.WriteLine(xx );
count++;
}
}
static void Main(string[] args)
{
Console.WriteLine("Hello to the this test app ---");
for (int i = 1; i<=3; i++)
{
Thread thread = new Thread(() => testThread("" + i + "__"));
thread.Start();
}
Console.ReadKey();
}
}
}
but the out but is
3__
3__
3__
3__
3__
3__
3__
3__
3__
3__
4__
4__
4__
4__
4__
what happens exactly anyone can explain please thanks