A long time ago…

When the computers were invented, they needed instructions from their human creators. We created specific languages to talk to them, to tell them what to do, when to do and how to do. We would tell them step by step what their tasks were. For a time being this approach was working. the humans and their computers were very happy.

Soon the humans created something called the Cloud. It was basically a bunch of computers put together, which would help humans solve larger, complex problems. With a large array of computers, meant a large array of processors all waiting for tasks from their human creators. But our language of code was only suitable for one processor at a time. We would tell the computer what to do, one of the processors would pick up our instruction list and work on it — the rest of the processors were idle.

Now we needed to utilize the full extent of computing power that was available when we mashed array of computers together. The concept of concurrency comes into the picture here.

How do we utilize all the cores on a computer to run our program faster?

Most of the languages were invented when the computers had only one processor, with the advent of Cloud, the languages had to be modified to enable concurrency. Even then, a new problem arose — our thinking was sequential, we all write code/logic in a sequential manner. How do we adapt our thinking in concurrent terms?

We started designing libraries, frameworks and methodologies to overcome this very problem. Then it struck us — Hey! Why don’t we design a language that in and itself is adapted to concurrency, rather than change existing languages to enable concurrency.

Enter Go! The language which is best suited to solve problems concurrently.

This article aims to explain the primitives of Concurrency in Go.

If you just need to learn the primitives and not bother about brief explanation of concepts, kindly scroll down to the tutorial part (Concurrency Guide).

#tutorial #golang #software-development #go #concurrency

Go: A Tale of Concurrency ( A Beginners Guide )
1.20 GEEK