Align structure to cache lines in Rust

Assuming I wanted to use cache coherency to do read-free locks such as FaRM , it would be sufficient to have a structure with one 64-byte array as data to ensure that in an architecture with 64-byte cache lines each Will the structure occupy exactly one cache line?

+4
source share
1 answer

No, this does not guarantee that alignment is a cache line.

There is currently no way to do this in Rust, although there is an open problem to implement#[repr(align = "64")] .

+6
source

Source: https://habr.com/ru/post/1663463/


All Articles