多核编程与并行计算
}
} public static void Main() { } ThreadStart thread1 = new ThreadStart(WithDraw1); Thread newThread1 = new Thread(thread1); ThreadStart thread2 = new ThreadStart(WithDraw2); Thread newThread2 = new Thread(thread2); newThread1.Start(); newThread2.Start(); int n = 20; if (n <= total) { } else { } Console.WriteLine("You do not enough money. n={0}", n); Console.WriteLine("total={0}", total); total -= n; Console.WriteLine("You have withdrawn. n={0}", n); Console.WriteLine("total={0}", total);