This repository contains categorized multithreading problems in C++. Each example includes commented code and explanations to help understand core multithreading concepts.
easy/– Beginner level problems (5)medium/– Intermediate level problems (10)hard/– Advanced level problems (5)
Use CMake to build each example.
- CMake 3.10+
- C++17 or above
- A C++ compiler like g++ or clang++
cmake .
makeNavigate to the specific executable and run:
./01_print_hello_from_threadsmake cleanWe’re excited that you want to contribute to C++ Multithreading Practice 🚀 This repository is for learning, practicing, and sharing C++ multithreading concepts.
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/<your-username>/cpp-multithreading.git
cd cpp-multithreadinggit checkout -b my-feature-branch- Commit and push:
git add .
git commit -m "Added: new multithreading problem"
git push origin my-feature-branch- Place new problems in the correct folder:
- easy/ – Beginner level problems
- medium/ – Intermediate level problems
- hard/ – Advanced level problems
- 01_print_hello_from_threads.cpp
- 02_thread_safe_queue.cpp
- Add comments and a short explanation at the top of each file.
- Ensure the code compiles without errors or warnings.
- Use C++17 or above.
- Be respectful and constructive.
- Write clean and well-documented code.
- Keep it beginner-friendly and easy to understand.
- Found a bug? → Open an Issue
- Have a suggestion? → Start a Discussion
- Want to contribute code? → Submit a Pull Request
MIT License.