Quick demonstration of multi threading in modern C++
Features:
- Creating task and threads
- Using function pointers, functors, and lambda functions
- Futures, promises, and async tasks
- Mutex and Locks
- Conditional Variables
- JThreads
- Supports Google Bazel
Here is the video explaining how to use multi-threading in C++:
|
git clone https://github.com/ourarash/multithreading_cpp.gitYou can run this either using bazel OR just plain g++.
For bazel:
bazel run src/main:mainFor g++:
g++ -std=c++20 -lpthread src/main/main.cc -I ./
./a.outFor instructions on installing Bazel and setting it up in Visual Studio Code see here