知识卡片

普通读书笔记卡 · 5376.a

共享写入可能触及内存墙

理解等级:中级

多线程频繁访问并修改共享数据,会增加缓存失效和内存流量,CPU可能因等数据而无法有效扩展,出现内存墙。可减少共享变量、改善缓存行为,或用显式消息与队列组织线程间通信。增核并不保证同比提速;原章八核饱和来自特定研究,不是硬件通用上限。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 理解性能的心智模型 · 查看原书依据

      Cache misses are handled by reducing shared variables among multiple processes and then optimizing cache behavior. For example, in his talk “Adventures with Concurrent Programming in Java: A Quest for Predictable Latency,” Martin Thomson describes in detail how they optimized the cache misses using Disruptor.17 The alternative is to do all communications between processes explicitly via message passing or a queue.

    参考来源

    - 位置:《Software Architecture and Decision-Making》第3章《理解性能的心智模型》(来源项目:book-sources;源文件:extracted/Software Architecture and Decision-Making Leveraging Leadership, Technology, and Product Management to Build Great Products… (Srinath Perera)/_epub-src/ch03.xhtml) - 结论依据:原文的定义、比较或例子支持“多线程频繁访问并修改共享数据,会增加缓存失效和内存流量,CPU可能因等数据而无法有效扩展,出现内存墙”;正文据此说明用途和边界。 - 原始内容:Cache misses are handled by reducing shared variables among multiple processes and then optimizing cache behavior. For example, in his talk “Adventures with Concurrent Programming in Java: A Quest for Predictable Latency,” Martin Thomson describes in detail how they optimized the cache misses using Disruptor.17 The alternative is to do all communications between processes explicitly via message passing or a queue.