競爭情況的C語言範例
競爭情況 (Race Condition)
至此,我們已經用 C 實作了作業系統中的 Thread 與 Deadlock 這兩種慨念,但事實上、這兩個概念之間是有關係的,要理解 Thread 與死結之間的關係,就必須從 Race Condition (競爭情況) 這個問題談起。
在多 Thread (或多 CPU) 的情況之下,兩個 thread 可以共用某些變數,但是共用變數可能造成一個嚴重的問題,那就是當兩個 thread…
These were the top 10 stories published by 程式人月刊 in May of 2018. You can also dive into daily archives for May of 2018 by using the calendar at the top of this page.