Skip to content

MehediMubin/go-concurrency-primitives

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Go Concurrent Primitives

This repository contains practical, hands-on examples demonstrating how to use Goโ€™s powerful concurrency primitives. From goroutines to mutexes, wait groups to semaphores โ€” it's all here!


๐Ÿ“ฆ Contents

Folder / File Description
mutex/ Mutex and RWMutex examples to prevent races
waitgroup/ Coordinating goroutines using WaitGroups
semaphore/ Limiting concurrency with semaphores
channels/ Communicating between goroutines
once/ Ensuring one-time operations with sync.Once
atomic/ Using sync/atomic for low-level concurrency

Each example is isolated and self-contained, making it easy to explore and test individually.


๐Ÿง  What You'll Learn

  • The difference between concurrency and parallelism
  • Safe access to shared memory using mutexes
  • Efficient coordination using WaitGroups
  • How RWMutex optimizes concurrent reads
  • Managing goroutine execution with semaphores
  • Atomic operations and thread-safe counters
  • And much more!

๐Ÿ›  How to Run

Clone the repo and run any file using:

go run <file>.go

About

Practical examples of Go's concurrency primitives like goroutines, mutexes, wait groups, and more.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages