sync.Map原理sync.Map 是高性能线程安全 map,核心思想是: 读写分离 数据结构: type Map struct { mu sync.Mutex // 写锁,保护写操作 read atomic.Value // 读专用 map,类型为 readOnly dirty map[interface{}]*entry // 写专用 map,保护修改 ... Feb 2, 2018 language, golang