- 博客(3)
- 收藏
- 关注
原创 伪共享问题
先来了解一些相关的概念缓存行(Cache Line):是缓存系统中的缓存单位;现代中央处理器的缓存系统中是以缓存行为单位存储的。缓存一致性:根据主流CPU为保证缓存有效性的MESI协议的简单理解,如果一个核正在使用的数据所在的缓存行被其他核修改,那么这个缓存行会失效,需要重新读取缓存。(在某时刻,一份缓存可能会存在于不同的缓存空间内;缓存一致性要求各个缓存区间内的同一份缓存必须一致,否则该缓存视为无效。)伪共享问题:当多线程修改互相独立的变量时,如果这些变量恰好共享同一个缓存行,就会彼此影响(写回
2021-06-02 23:15:38
125
原创 对String.intern()的理解
首先看看官方怎么说When the intern method is invoked,if the pool already contains a string equal to this String object as determined by the equals(Object) method, then the string from the pool is returned.Otherwise, this String object is added to the pool and a
2021-06-01 20:54:42
163
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人