News for hackers. Stuff that matters.
Re:How to think about `async`/`await` in Rust by tylerhou on Wednesday July 05, 2023 @08:58PM (#36609521)
There are barriers for join. But without barriers, the risk is compiler reordering/lift to registers/thread scheduling. The CPU cache would not be the direct cause of any “stale” reads. https://news.ycombinator.com/item?id=36333034
Re:How to think about `async`/`await` in Rust by im3w1l on Thursday July 06, 2023 @07:44AM (#36614376)
Well I knew there were possible issues both from the compiler and the cpu. It seems you are right that the cache is kept coherent, however there is another issue owing to out-of-order execution of cpu instructions. Either way, gpderreta is probably right that thread.join tells the compiler to make sure it's all taken care of correctly.