multithreading_cpp icon indicating copy to clipboard operation
multithreading_cpp copied to clipboard

Tutorial on Multithreading in C++

Multi Threading Tutorial in C++

Quick demonstration of multi threading in modern C++

Features:

  • [x] Creating task and threads
  • [x] Using function pointers, functors, and lambda functions
  • [x] Futures, promises, and async tasks
  • [x] Mutex and Locks
  • [x] Conditional Variables
  • [x] Supports Google Bazel

Here is the video explaining how to use multi-threading in C++:

Debugging C++ in Visual Studio Code using gcc/gdb and Bazel

Installation

git clone https://github.com/ourarash/multithreading_cpp.git

Running examples:

You can run this either using bazel OR just plain g++.

For bazel:

bazel run src/main:main

For g++:

g++ -std=c++17 -lpthread src/main/main.cc  -I ./
./a.out

Bazel Installation and Visual Studio Setup

For instructions on installing Bazel and setting it up in Visual Studio Code see here