Cache line

獲取cache的配置

cat /sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size

程序中使用cacheline對齊的方式

#define CACHE_LINE (128)
struct test_cache {
    int a;
}__attribute__((aligned(CACHE_LINE)));
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章