Go Routines - LogeshVel/go_programs GitHub Wiki





Synchronization - WaitGroup



Goroutine Communication

Channels




Buffered channel




Iterating through channel


Select statement




Default select

sharing resources



Interleaving happens at the machine code instructions. Since a simple source code instruction has many machine code instructions


Mutex




Once Synchronization

Sync.Once



*Note: Ignore the capitalization typo in the next slide

Deadlock






Quiz




deadlock cannot always be detected by the Golang runtime. The First level of dead locks can be detected by the runtime. but the subset of deadlocks cannot be detected. Subset means a go routine calls another go routine and that go routine depends on another go routine made some daedlock in the second hierarchy level
