|
|
|
|
|
by psurge
1297 days ago
|
|
C++17 has std::hardware_destructive_interference_size which you can use in conjunction with alignas to get this behavior, see https://en.cppreference.com/w/cpp/thread/hardware_destructiv... I’m not sure whether a single target architecture can (either in theory or in practice) map to hardware with different line sizes. If so, another problem is that the compiler’s idea of the cache line size might not match the hardware’s. |
|
[1]: https://www.mono-project.com/news/2016/09/12/arm64-icache/