Skip to content

Commit dede52c

Browse files
committed
sync.Map 拓展
1 parent 32fd5a4 commit dede52c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sync.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,9 @@ func (e *entry) tryExpungeLocked() (isExpunged bool) {
10041004
return p == expunged
10051005
}
10061006
```
1007-
1007+
- sync.Map 利用了读写分离的思路为读多写少或读写不同 key 的场景而设计,当违背这种设计初衷来使用 sync.Map 的时候性能或许达不到你的期待
1008+
- 可以参考下其他诸如散列思路减少锁开销的并发安全 [Map](https://github.com/orcaman/concurrent-map/
1009+
)
10081010
# 参考资料
10091011

10101012
http://www.weixianmanbu.com/article/736.html

0 commit comments

Comments
 (0)