[Solved] High CPU With Multithreading In C#


Try this instead:

private static void aaa()
{
    Console.WriteLine("123");
}

private static void Start2()
{
    try
    {
        Program.t = new Thread(delegate()
        {
            Program.aaa();
        });
        Program.t.Start();
        while(t.IsAlive)
            Thread.Sleep(500);
        GC.Collect();
        GC.WaitForPendingFinalizers();
        GC.Collect();
    }
    catch (Exception value)
    {
        Console.WriteLine(value);
    }
}

solved High CPU With Multithreading In C#