Go map原理剖析

2019-10-08
阅读 31 分钟
5.5k
在使用map的过程中,有两个问题是经常会遇到的:读写冲突和遍历无序性。为什么会这样呢,底层是怎么实现的呢?带着这两个问题,我简单的了解了一下map的增删改查及遍历的实现。

深入理解Go-sync.Map原理剖析

2019-09-08
阅读 8 分钟
6.3k
Map is like a Go map[interface{}]interface{} but is safe for concurrent useby multiple goroutines without additional locking or coordination.Loads, stores, and deletes run in amortized constant time.