// written by kutay zorlu
// when you INCREASE count of threads it is decreasing performce of prosess
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace zip___test
{
class Program
{
public static Thread[] MyThreads = new Thread[10];
public static Name_creator[] asd = new Name_creator[10];
public int a = 0;
public static int Main(string[] args)
{
Name_creator me = new Name_creator();
for (int I = 0; I < 10; I++){
//MyThreads[I] = new Thread(new ThreadStart(me.MyThreadProc)); // Thread Sayısı artıkdca performans azalıyor
//MyThreads[I] = new Thread(new ThreadStart());
MyThreads[I] = new Thread(new ThreadStart( me.ThreadProc));
MyThreads[I].Start();
}
Console.Write("Zips starting ");
Console.ReadKey();
return 1;
}
public static void ThreadProc()
{
for (int i = 0; i < 100; i++)
{
Console.WriteLine("Kutay : "+i+"\n");
}
}
}
class Name_creator
{
zip___test.Program asd = new Program();
string date = DateTime.Now.ToString();
public Name_creator()
{
date += date+"_KZ";
}
public void ThreadProc()
{
for (int i = 0; i < 10000; i++)
{
asd.a++;
Console.WriteLine("date: " +date+"Kutay : " + i + "\n"+asd.a);
}// 45 saniyeye
}
}
}