Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Concurrency in Go (Golang)
Rating: 4.4 out of 5(1,422 ratings)
16,032 students

Concurrency in Go (Golang)

Learn the Why's and How's of concurrency in Go.
Last updated 5/2022
English

What you'll learn

  • How to spin Goroutines and communicate data between them.
  • How to avoid Race conditions and Deadlocks.
  • How to synchronize the execution of Goroutines.
  • How Go Scheduler works.
  • How to build streaming pipelines with Goroutines and Channels.
  • How to propagate data across API boundary.

Course content

14 sections77 lectures5h 0m total length
  • Introduction6:05

    Explore concurrency in Go, using built-in support and goroutines to divide a large workload into independent parts, enabling parallelism on multi-core processors while preserving correct results.

  • Course Overview5:06

    Explore Go's concurrency primitives and patterns, including goroutines, channels, mutexes, and the context package, with streaming pipelines, race detection, and practical examples like a web crawler and image processing pipeline.

  • Processes and Threads7:51

    Explore why Go uses concurrency primitives by reviewing processes and threads. Learn how the operating system's scheduler and context switching affect performance, including C10k limits.

  • Why Concurrency is hard6:27

    Explore why concurrency is hard as shared memory among threads causes data races and non-deterministic outcomes. Learn how locks guard memory access, create exclusive sections, and trade parallelism for safety.

Requirements

  • Basic knowledge of Go Programming Language like loops, functions, methods.
  • Installation of Go compiler and any IDE on the laptop.

Description

Questions that comes to all Developers is whether they are utilising the available Computing resource efficiently? 

Course Overview

The course could be divided into five parts.

  • Concurrency Primitives

  • Deep Dive into Concurrency Primitives

  • Concurrency Patterns

  • Context Package

  • Bonus Section - Interfaces

In the course we try to answer these questions.

Concurrency Primitives

  • What are the limitations of Threads?

  • What are advantages of goroutines over OS threads?

  • How do we avoid race condition?

  • How Channels are used to communicate data?

  • How do we implement timeout and non-blocking communication?

  • When do we use mutex and channels?

  • How to synchronise execution of goroutines?

  • How to detect race condition in Go?

Deep Dives into Concurrency Primitives

  • How Go scheduler works?

  • How does context switching works?

  • How channel send and receive works underneath?

Concurrency Patterns

  • How to construct streaming pipelines with Goroutines and Channels?

  • How to Fan-out and Fan-in computationally intensive stages?

  • How do we avoid Goroutine Leaks?

Context Package

  • How we can propagate request scoped data and cancellation signal across API boundaries?

Coding Exercises

  • Each concept is followed by a Coding Exercise.

  • Exercises blueprint are shared on Github.

Sample Applications

We will build

  • Blueprint of web crawler.

  • Image processing pipeline.

  • HTTP Server Timeouts with Context Package.

Bonus Section - Interfaces

  • How to define common behaviour between different objects as abstract type?

  • How Interface provides an abstraction for higher level functions?

Who this course is for:

  • Students looking for Basic to Advanced Go Programming Concepts