合集-Golang源码
摘要:源码 // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LI
阅读全文
摘要:概括 sync.Map的实现原理可概括为: 通过 read 和 dirty 两个字段将读写分离,读取时会先查询 read,不存在再查询 dirty,写入时则只写入 dirty,所以read相当于dirty的缓存。 读取 read 并不需要加锁,而读或写 dirty 都需要加锁。 misses 字段统
阅读全文

浙公网安备 33010602011771号