Multithreading Fundamentals in C++

This course provides an introduction to multithreading in C++. It covers the main difficulties of writing concurrent code and basic synchronization primitives. Special attention is paid to understanding classical problems of parallel programming, which demonstrate solutions to the most common problems.

  • duration 16 hours
  • Language English
  • format Online
duration
16 hours
location
Online
Language
English
Code
C-006
price
€ 450 *

Available sessions

To be determined



Training for 7-8 or more people?
Customize trainings for your specific needs

Description

Multithreading is a critical aspect of modern programming, allowing developers to create efficient and responsive applications. This course delves into the core concepts and techniques of multithreading in C++, covering essential topics such as multitasking, processes and threads, synchronization problems, memory models, bottlenecks, deadlocks, atomics, and non-blocking algorithms. Through a combination of lectures, hands-on exercises, and real-world examples, students will gain a comprehensive understanding of multithreading principles and best practices.

 

Course Objectives:

  • Understanding Multitasking: Explore the concept of multitasking and its importance in modern computing. Learn how operating systems manage concurrent execution and how C++ facilitates multitasking through processes and threads.
  • Processes and Threads: Differentiate between processes and threads and understand their respective advantages and limitations. Learn how to create, manage, and synchronize threads in C++ using standard library facilities.
  • Synchronization Problems: Investigate common synchronization problems encountered in multithreaded applications, including the reader-writer problem, producer-consumer problem, dining philosophers problem, bottlenecks, and deadlocks. Implement solutions using synchronization primitives such as mutexes, condition variables, and semaphores.
  • Memory Model: Gain insight into the C++ memory model and its implications for multithreaded programming. Explore concepts such as memory ordering, data races, and thread safety, and learn how to write robust and thread-safe code.
  • Atomics and Non-blocking Algorithms: Discover the atomic operations and non-blocking algorithms in C++ and their role in writing lock-free and wait-free code. Learn how to use atomic types and operations effectively to achieve concurrency without traditional locking mechanisms.

  

This course combines theoretical knowledge with practical hands-on exercises to reinforce learning. Lectures will cover fundamental concepts and best practices, supplemented by coding sessions where students will implement multithreaded solutions to various synchronization problems, bottlenecks, and deadlocks.

 

This course is designed for beginner C++ programmers seeking to deepen their understanding of multithreading concepts and techniques. Software developers, system architects, and anyone involved in designing or maintaining multithreaded applications will benefit from the knowledge and skills gained in this course.

 

Upon completion of this course, students will have a solid understanding of multithreading fundamentals in C++ and will be equipped with the skills to design, implement, and debug multithreaded applications efficiently. They will be able to identify and mitigate bottlenecks and deadlocks, tackle common synchronization problems, leverage atomic operations and non-blocking algorithms, and write thread-safe and scalable code using modern C++ features.

After completing the course, a certificate is issued on the Luxoft Training form

Objectives

    • Understand the main difficulties in developing concurrent code and ways to overcome them;
    • Learn how to use classical synchronization primitives and understand their algorithms and internal representation;
    • Review solutions to fundamental problems of concurrent programming and find their analogs in real-life problems;
    • Understand lock-free algorithms.

Target Audience

Primary:

  • Developers having knowledge of C++ and lacking experience in multithreading.

Additional:

  • Architects, system designers, and developers using other programming languages but willing to understand multithreading programming.

Prerequisites

Ability to understand C++ code.


Roadmap

[Theory – 0.5h] Threads and processes. Concurrency, parallelism, and multithreading

How multitasking is implemented in modern operating systems. What is the difference between parallel and concurrent program execution

[Theory – 0.5h; Practice – 0.5h] Thread creation and interrupting

How to create threads of execution, basic methods of communication between threads

[Theory - 1h] Data races, deadlocks, bottlenecks.

What difficulties usually arise in writing multithreading code, and what problems can they lead to

[Theory – 1h; Practice – 0.5h] Synchronization: semaphores, mutexes and conditional variables.

Synchronizing access to shared resources with various synchronization primitives

[Theory – 3h; Practice - 6h] Classical tasks: reader-writer, producer-consumer, dining philosophers

Common tasks of multithreading programming in examples based on classical problems

[Theory – 1h; Practice – 0.5h] Atomic data types, memory model, lock-free algorithms

How to provide synchronization without mutexes. Atomic operations and memory model

[Theory – 0.5h; Practice - 1h] Thread pools.

Multithreading does not always guarantee high performance. In certain cases, additional solutions are required, such as thread pools.

[Theory – 7.5h (47%); Practice – 8.5h (53%)]


    • Trainer

    Denys Zamyatin


    Related courses

    You may also be interested in

    Discover more about professional growth and skills development

    contact us