Advanced Go (Golang)
Q92 / 100

What is Go's sync.Map vs a map with RWMutex for read-heavy workloads?

Correct! Well done.

Incorrect.

The correct answer is B) sync.Map excels when: same keys are read repeatedly, goroutines access disjoint keys. For high-write or small maps, mutex+map has lower overhead

B

Correct Answer

sync.Map excels when: same keys are read repeatedly, goroutines access disjoint keys. For high-write or small maps, mutex+map has lower overhead

Explanation

sync.Map benchmarks show benefits for stable, high-concurrency read-heavy maps. For general use, measure: sync.Map has higher overhead per operation due to interface{} boxing.

Progress
92/100