Wait Group

Noun · Development

Definitions

  1. A synchronization primitive, most associated with Go's sync.WaitGroup, that maintains an internal counter which goroutines increment before starting work and decrement when done, allowing a parent routine to block on Wait() until all spawned work completes.

    In plain English: A counter that lets the main program wait until all its background tasks have finished before moving on.

    Example: "I added a WaitGroup so the main goroutine doesn't exit before all the worker goroutines finish processing the batch."

Related Terms