[.net 多线程] Interlocked实现CAS操作
摘要:Interlocked:为多个线程共享的变量提供原子操作。 实现原子级运算 1 int increament = 0; 2 Thread th1 = new Thread(() => 3 { 4 for (int i = 0; i < 10; i++) 5 Console.WriteLine($"t
阅读全文
posted @ 2018-05-06 14:23
posted @ 2018-05-06 14:23
posted @ 2018-05-05 16:02
posted @ 2018-05-05 15:41