diff --git a/c3-m2/main.go b/c3-m2/main.go index a5c83ff..b606801 100644 --- a/c3-m2/main.go +++ b/c3-m2/main.go @@ -24,3 +24,16 @@ func bar(a *int, wg *sync.WaitGroup) { fmt.Println(*a) wg.Done() } + +/** +Race Condition + Interleave: If I have 2 task and Order of execution between concurrent tasks + is not known, it's not determined, meaning it's not deterministic + It means these tasks can be interleaved in different ways. + Interleave is happening at the machine code level rather than the source code + + Race condition is a problem where the outcome of the program depends on the interleaving + And Interleaving is non-deterministic. + It's determined by the operating system and the Go-runtime. + So, the interleaving can change every time you run it. +**/