Parallel and Concurrent Programming with C++ Part 1

Parallel and Concurrent Programming with C++ Part 1

1h 59mAdvanced2020-05-15

Authors

Barron Stone

Barron Stone

Electrical Engineer

Olivia Chiu Stone

Olivia Chiu Stone

Programmer, Engineer

Course details

Parallel programming unlocks a program’s ability to execute multiple instructions simultaneously. It increases the overall processing throughput and is key to writing faster and more efficient applications. This training course introduces the basics of concurrent and parallel programming in C++, providing the foundational knowledge you need to write more efficient, performant code. Instructors Barron and Olivia Stone explain concepts like threading and mutual exclusion in a fun and informative way, relating them to everyday activities you perform in the kitchen. To cement the ideas, they demo them in action using C++. Each lesson is short and practical, driving home the theory with hands-on techniques.

Topics include:
Parallel computing architectures
Shared vs. distributed memory
Thread vs. process
Execution scheduling
The thread lifecycle in C++
Mutual exclusion
Locking in recursive and shared mutexes
Acquiring a lock on a mutex with a try lock
Resolving deadlock and livelock conditions

Skills covered

C++Programming FoundationsProgramming LanguagesOpen SourceSoftware DevelopmentDeep Dive (X:Y)

Concepts

Introduction

  • Learn parallel programming basics
  • What you should know
  • Installing Cygwin and Visual Studio Code

Parallel Computing Hardware

  • Sequential versus parallel computing
  • Parallel computing architectures
  • Shared versus distributed memory

Threads and Processes

  • Thread versus process
  • Thread versus process - C++ demo
  • Concurrent versus parallel execution
  • Execution scheduling
  • Execution scheduling - C++ demo
  • Thread life cycle
  • Thread life cycle - C++ demo
  • Detached thread
  • Detached thread - C++ demo

Mutual Exclusion

  • Data race
  • Data race - C++ demo
  • Mutual exclusion
  • Mutual exclusion - C++ demo
  • Atomic objects - C++ demo

Locks

  • Recursive mutex
  • Recursive mutex - C++ demo
  • Try lock
  • Try lock - C++ demo
  • Shared mutex
  • Shared mutex - C++ demo

Liveness

  • Deadlock
  • Deadlock - C++ demo
  • Abandoned lock
  • Abandoned lock - C++ demo
  • Starvation
  • Starvation - C++ demo
  • Livelock
  • Livelock - C++ demo

Conclusion

  • Next steps
40,000 Toman