📄️ Introduction
Introduction To Concurrency
📄️ WaitGroups
In the previous article, Introduction to Concurrency in Golang, of the series,Concurrency in Golang, we came across a problem where one or more goroutines might not necessarily finish execution before the main goroutine does, thus we were unable to see the message printed by the unfinished goroutine. We fixed the issue by adding time.Sleep() in the main goroutine to put it to sleep for a few seconds and thus increasing the probability of other goroutines finishing before the main does. Although our code worked in that particular case, most certainly it will not work for all cases. In this article, we will see, how we can make use of the WaitGroup synchronization primitive provided by Go.
📄️ Race Condition
Writing a concurrent code is often a difficult task. often programmers working with concurrent code, face similar kinds of bugs. One of them is inconsistency while manipulating the data using concurrent goroutines.
📄️ Mutex Lock
While writing concurrent code in golang, often programs face situations when two or more goroutines try to access and modify shared variables. Such conditions can lead to inconsistency in data stored in the shared variable. Such conditions are called Race conditions. You can learn more about race conditions from our previous article of this course, Race conditions in Golang.
📄️ Channels
Channels In Golang