Mô tả

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

Bạn sẽ học được gì

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.

Yêu cầu

  • Some experience of programming in Go (enough if you know how to use functions, loops, arrays and a bit of pointers).
  • Recent version of Go installed.
  • Being able to do 50 push-ups while shouting a unique prime number on each rep (just kidding).

Nội dung khoá học

10 sections

Introduction

3 lectures
Understanding Parallel Computing
04:23
More on Parallel Computing
05:50
Links and Resources for this course
00:22

Creating and using Threads

8 lectures
Processes, Threads and Green threads
12:27
Using Goroutines for Boids
04:18
Groundwork for our simulation
05:13
Starting our Goroutines
08:53
Memory sharing between Threads
06:46
Memory Sharing example Part 1
05:37
Memory Sharing example Part 2
06:40
Using Threads Quiz
4 questions

Thread Synchronization with Mutexes

6 lectures
Why do we need Locking?
08:59
Using Mutexes in Boid simulation
05:46
Adding Synchronization to simulation
05:26
Readers-Writer Locks
07:12
Boid Synchronization with Readers-Writers Locks
07:13
Mutexes Quiz
4 questions

Waiting for Completed tasks

3 lectures
Understanding WaitGroups
06:42
Concurrent file searching with WaitGroups
07:49
WaitGroup Quiz
3 questions

Message passing with Channels

7 lectures
Thread Communication using Channels
10:07
Pipelining Example
12:31
Understanding Thread Pools
07:59
Thread Pool Example Part 1
08:17
Thread Pool Example Part 2
06:06
Shoelace algorithm explained (optional)
00:05
Channels Quiz
3 questions

Synchronization using Condition Variables

5 lectures
What's a Condition Variable?
07:00
Parallel Algorithm for Matrix Multiplication
09:27
Implementing Parallel Matrix Multiplication Part 1
07:05
Implementing Parallel Matrix Multiplication Part 2
06:06
Condition Variable Quiz
3 questions

Deadlocks

8 lectures
Deadlocking Robots, Philosophers and Trains
08:29
Simple Deadlock Example
04:17
Train Deadlock Example Part 1
03:40
Train Deadlock Example Part 2
08:29
Solving Deadlocks using Resource Hierarchy
07:08
Implementing Resource Hierarchy Solution
06:54
Solving Deadlocks using an Arbitrator
08:10
Implementing Arbitrator Solution
05:36

Barriers

3 lectures
Barriers Explained
07:45
Building a Barrier
08:02
Barriers with Matrix Multiplication
07:45

Atomic Variables

4 lectures
Understanding Atomic Variables
08:57
Atomic Variables Example
02:59
Building a Letter Frequency Program
07:24
Using Atomic Variables in our Example
07:03

Spinning Locks

5 lectures
Locking using Spinning locks
06:15
Building our own Spinning locks
04:54
Ledger Example
09:50
Implementing the Ledger Part 1
06:42
Implementing the Ledger Part 2
09:47

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.