谢宝友 中兴通讯操作系统团队
scxby@163.com
——并行编程的基石
Linux内存屏障
从硬件说起
• 霍金提出的难题
• 硬件制造商的努力
计数的难题
缓存一致性协议及内存屏障
• 为什么需要内存屏障
• 内存屏障在锁中的用法
感谢
目 录
© ZTE Corporation. All rights reserved
3
According to Stephen Hawking
the finite speed of light
and the atomic nature of matter
How about
量子理论?
弦论?
从硬件说起——霍金提出的难题
© ZTE Corporation. All rights reserved
4
3D集成
降低光程、减少能耗,但是制造、测试和散热(用钻石)??
新材料和新工艺
单个电子上存储多个比特位,不稳定
用光代替电子
光速也有极限
丏用加速器
GPU、矢量处理器、专用加密硬件,比较靠谱
从硬件说起——硬件制造商的努力
摩尔定律失效了
© ZTE Corporation. All rights reserved
5
long counter = 0;
void inc_count(void)
{
counter++;
}
long read_count(void)
{
return counter;
}
计数的难题——代码例子
atomic_t counter = ATOMIC_INIT(0);
void inc_count(void)
{
atomic_inc(&counter);
}
long read_count(void)
{
return atomic_read(&counter);
}
丢失计数
正确,但是性能?
评论13
最新资源