The Cross-Core Contract: Memory Ordering and Single-Writer State in Lock-Free Rust

The Cross-Core Contract: Memory Ordering and Single-Writer State in Lock-Free Rust Part 2 of Low-Level Systems Design in Rust - a series on writing high-throughput, low-latency systems code, using a single-producer / single-consumer (SPSC) ring buffer as the running example. Part 1, Cache-Conscious Data Layout , decided where the shared fields of a concurrent structure live in memory. This one covers how two cores read and write those fields - correctly, and as cheaply as the hardware allows. As before, the

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论