摘要:
需求 读写共享map #1 常规map package main import ( "fmt" "strconv" "sync" ) func _110Test1() { wg := sync.WaitGroup{} mp := make(map[string]int) for i := 0; i 阅读全文
摘要:
不加锁 package main import ( "fmt" "sync" ) var x=0 var wg107 sync.WaitGroup func add1() { for i := 0; i < 50000; i++ { x += 1 } wg107.Done() } func test 阅读全文