We may earn an affiliate commission when you visit our partners.
Course image
Udemy logo

Mastering Multithreading Programming with Go (Golang)

James Cutajar

The mood in the meeting on the 12th floor of an international investment bank was as bleak as it gets. The developers of the firm met to discuss the best way forward after a critical core application failed and caused a system wide outage.

Read more

The mood in the meeting on the 12th floor of an international investment bank was as bleak as it gets. The developers of the firm met to discuss the best way forward after a critical core application failed and caused a system wide outage.

"Guys, we have a serious issue here. I found out that the outage was caused by a race condition in our code, introduced a while ago and triggered last night." says Mark Adams, senior developer.

The room goes silent. The cars outside the floor to ceiling windows slowly and silently creep along in the heavy city traffic. The senior developers immediately understand the severity of the situation, realizing that they will now be working around the clock to fix the issue and sort out the mess in the datastore. The less experienced developers understand that a race condition is serious but don't know exactly what causes it and therefore keep their mouths shut.

Eventually Brian Holmes, delivery manager, breaks the silence with "The application has been running for months without any problems, we haven't released any code recently, how is it possible that the software just broke down?. "

Everyone shakes their heads and goes back to their desk leaving Brian in the room alone, puzzled. He takes out his phone and googles "race condition".

Sound familiar? How many times have you heard another developer talking about using threads and concurrent programming to solve a particular problem but out of fear you stayed out of the discussion?

Here's the little secret that senior developers will never share... Multithreading programming is not much harder than normal programming. Developers are scared of concurrent programming because they think it is an advanced topic that only highly experienced developers get to play with.

This is far from the truth. Our minds are very much used to dealing with concurrency. In fact we do this in our everyday life without any problem but somehow we struggle to translate this into our code. One of the reasons for this is that we're not familiar with the concepts and tools available to us to manage this concurrency. This course is here to help you understand how to use multithreading tools and concepts to manage your parallel programming. It is designed to be as practical as possible. We start with some theory around parallelism and then explain how the operating system handles multiple processes and threads. Later we move on to explain the multiple tools available by solving example problems using multithreading.

In this course we use Google's Go programming language with its goroutines, however the concepts learned here can be applied to most programming languages.

All code in this course can be found on github, username/project: cutajarj/multithreadingingo

Enroll now

What's inside

Learning objectives

  • Discover how to create responsive and high performance software.
  • See how to use multithreading for modeling certain types of problems and simulations.
  • Develop programs with golang that are highly concurrent and parallel.
  • Understand the advantages, limits and properties of parallel computing.
  • Improve your programming skills in go with more advanced, mulithreading topics.
  • Learn about goroutines, mutexes, reader writers locks, waitgroups, channels, condition variables and more.

Syllabus

Introduction
Understanding Parallel Computing
More on Parallel Computing
Links and Resources for this course
Read more
Creating and using Threads
Processes, Threads and Green threads
Using Goroutines for Boids
Groundwork for our simulation
Starting our Goroutines
Memory sharing between Threads
Memory Sharing example Part 1
Memory Sharing example Part 2
Using Threads Quiz
Thread Synchronization with Mutexes
Why do we need Locking?
Using Mutexes in Boid simulation
Adding Synchronization to simulation
Readers-Writer Locks
Boid Synchronization with Readers-Writers Locks
Mutexes Quiz
Waiting for Completed tasks
Understanding WaitGroups
Concurrent file searching with WaitGroups
WaitGroup Quiz
Message passing with Channels
Thread Communication using Channels
Pipelining Example
Understanding Thread Pools
Thread Pool Example Part 1
Thread Pool Example Part 2
Shoelace algorithm explained (optional)
Channels Quiz
Synchronization using Condition Variables
What's a Condition Variable?
Parallel Algorithm for Matrix Multiplication
Implementing Parallel Matrix Multiplication Part 1
Implementing Parallel Matrix Multiplication Part 2
Condition Variable Quiz
Deadlocks
Deadlocking Robots, Philosophers and Trains
Simple Deadlock Example
Train Deadlock Example Part 1
Train Deadlock Example Part 2
Solving Deadlocks using Resource Hierarchy
Implementing Resource Hierarchy Solution
Solving Deadlocks using an Arbitrator
Implementing Arbitrator Solution
Barriers
Barriers Explained
Building a Barrier
Barriers with Matrix Multiplication
Atomic Variables
Understanding Atomic Variables
Atomic Variables Example
Building a Letter Frequency Program
Using Atomic Variables in our Example
Spinning Locks
Locking using Spinning locks
Building our own Spinning locks
Ledger Example
Implementing the Ledger Part 1
Implementing the Ledger Part 2

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Examines the impacts and applications of multithreading in software development
Perfect for those looking to write scalable and performant software
Taught by an experienced software developer with a proven track record
Appropriate for learners with some programming experience, especially in Go
Requires learners to have a basic understanding of computer architecture and operating systems
Provides a solid foundation for those seeking to advance their skills in concurrent programming

Save this course

Save Mastering Multithreading Programming with Go (Golang) to your list so you can find it easily later:
Save

Activities

Coming soon We're preparing activities for Mastering Multithreading Programming with Go (Golang). These are activities you can do either before, during, or after a course.

Career center

Learners who complete Mastering Multithreading Programming with Go (Golang) will develop knowledge and skills that may be useful to these careers:
Concurrency Architect
A Concurrency Architect designs and implements software systems that can take advantage of multiple processors or cores to improve performance and efficiency. The course Mastering Multithreading Programming with Go (Golang) provides a deep dive into the concepts and tools needed to develop concurrent and parallel programs, including goroutines, mutexes, reader writers locks, waitgroups, channels, condition variables and more. By understanding how to manage concurrency effectively, Concurrency Architects can create high-performance software that can handle complex and demanding workloads.
Multithreading Developer
A Multithreading Developer specializes in developing software that utilizes multiple threads of execution to improve performance and efficiency. The course Mastering Multithreading Programming with Go (Golang) provides a comprehensive overview of multithreading programming, covering topics such as creating and using threads, memory sharing between threads, thread synchronization with mutexes and readers-writers locks, waiting for completed tasks with waitgroups, message passing with channels, synchronization using condition variables, deadlocks, barriers, atomic variables, and spinning locks. With this knowledge, Multithreading Developers can design and implement robust and scalable software systems.
Software Engineer
A Software Engineer designs, develops, and maintains software systems. The course Mastering Multithreading Programming with Go (Golang) provides a solid foundation in multithreading programming, which is becoming increasingly important as software systems become more complex and demanding. By understanding how to develop concurrent and parallel programs, Software Engineers can create high-performance software that can handle complex and demanding workloads.
High-Performance Computing Engineer
A High-Performance Computing Engineer designs and develops software and hardware systems that can handle complex and demanding workloads. The course Mastering Multithreading Programming with Go (Golang) provides a deep understanding of multithreading programming, which is essential for developing high-performance software. By understanding how to manage concurrency effectively, High-Performance Computing Engineers can create software that can take advantage of multiple processors or cores to improve performance and efficiency.
Systems Programmer
A Systems Programmer develops and maintains operating systems and other low-level software. The course Mastering Multithreading Programming with Go (Golang) provides a comprehensive overview of multithreading programming, covering topics such as creating and using threads, memory sharing between threads, thread synchronization with mutexes and readers-writers locks, waiting for completed tasks with waitgroups, message passing with channels, synchronization using condition variables, deadlocks, barriers, atomic variables, and spinning locks. With this knowledge, Systems Programmers can develop robust and efficient operating systems and other low-level software.
Database Architect
A Database Architect designs and implements database systems. The course Mastering Multithreading Programming with Go (Golang) provides a deep understanding of multithreading programming, which is essential for developing high-performance database systems. By understanding how to manage concurrency effectively, Database Architects can create database systems that can handle complex and demanding workloads.
DevOps Engineer
A DevOps Engineer automates and integrates software development and IT operations. The course Mastering Multithreading Programming with Go (Golang) provides a deep understanding of multithreading programming, which is essential for developing high-performance software systems. By understanding how to manage concurrency effectively, DevOps Engineers can create software systems that can be deployed and operated efficiently.
Cloud Engineer
A Cloud Engineer designs and implements cloud-based solutions. The course Mastering Multithreading Programming with Go (Golang) provides a deep understanding of multithreading programming, which is essential for developing high-performance cloud-based solutions. By understanding how to manage concurrency effectively, Cloud Engineers can create cloud-based solutions that can handle complex and demanding workloads.
Machine Learning Engineer
A Machine Learning Engineer develops and deploys machine learning models. The course Mastering Multithreading Programming with Go (Golang) provides a deep understanding of multithreading programming, which is essential for developing high-performance machine learning models. By understanding how to manage concurrency effectively, Machine Learning Engineers can create machine learning models that can be trained and deployed efficiently.
Data Engineer
A Data Engineer designs and implements data pipelines. The course Mastering Multithreading Programming with Go (Golang) provides a deep understanding of multithreading programming, which is essential for developing high-performance data pipelines. By understanding how to manage concurrency effectively, Data Engineers can create data pipelines that can handle complex and demanding workloads.
Computer Scientist
A Computer Scientist researches and develops new computer technologies. The course Mastering Multithreading Programming with Go (Golang) provides a deep understanding of multithreading programming, which is an essential part of modern computer science. By understanding how to manage concurrency effectively, Computer Scientists can develop new computer technologies that are more efficient and scalable.
Computer Programmer
A Computer Programmer develops and maintains software programs. The course Mastering Multithreading Programming with Go (Golang) provides a deep understanding of multithreading programming, which is essential for developing high-performance software programs. By understanding how to manage concurrency effectively, Computer Programmers can create software programs that are scalable and efficient.
Software Architect
A Software Architect designs and implements software systems. The course Mastering Multithreading Programming with Go (Golang) provides a deep understanding of multithreading programming, which is essential for developing high-performance software systems. By understanding how to manage concurrency effectively, Software Architects can create software systems that are scalable and efficient.
Systems Administrator
A Systems Administrator maintains and operates computer systems. The course Mastering Multithreading Programming with Go (Golang) provides a deep understanding of multithreading programming, which is becoming increasingly important as computer systems become more complex and demanding. By understanding how to manage concurrency effectively, Systems Administrators can maintain and operate computer systems more efficiently.
Web Developer
A Web Developer designs and develops websites. The course Mastering Multithreading Programming with Go (Golang) provides a deep understanding of multithreading programming, which is essential for developing high-performance web applications. By understanding how to manage concurrency effectively, Web Developers can create web applications that are scalable and efficient.

Reading list

We've selected seven books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Mastering Multithreading Programming with Go (Golang).
A comprehensive guide to concurrency in Go, covering topics such as goroutines, channels, and synchronization.
Covers the basics of the Go programming language, including concurrency and multithreading.
A widely used textbook that covers the fundamentals of operating systems, including concurrency and scheduling.
Provides a comprehensive overview of computer systems, including topics such as concurrency and scheduling.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to Mastering Multithreading Programming with Go (Golang).
Learn Parallel Computing in Python
Most relevant
Complete Guide to Python Multithreading and...
Most relevant
Java Multithreading, Concurrency & Performance...
Most relevant
Mastering Multithreading with Go
Most relevant
Working with Concurrency in Go (Golang)
Most relevant
Android Multithreading Masterclass
Concurrent Programming in Java
Modern C++ Concurrency in Depth ( C++17/20)
Python Programming - Multithreading, OOP, NumPy and Pandas
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser