typeover
curriculum

Curriculum Concurrency Sync primitives exercise 2 · mcq

Sync primitives

Pick the IDIOMATIC pattern for guarding access to a shared counter count with mu sync.Mutex from inside a function.

TypeScript reference
Pick the idiomatic Go translation

About this theme

sync.Mutex, sync.RWMutex, sync.WaitGroup, sync.Once. The classical concurrency toolbox. Go's culture prefers channels for orchestration and sync for protecting state. Use whichever makes the code clearer; don't pick a side as a religion.