Skip to content

This repository contains categorized multithreading problems in C++. Each example includes commented code and explanations to help understand core multithreading concepts.

License

Notifications You must be signed in to change notification settings

DigraJatin/cpp-multithreading

 
 

Repository files navigation

C++ Multithreading Practice

This repository contains categorized multithreading problems in C++. Each example includes commented code and explanations to help understand core multithreading concepts.

Structure

  • easy/ – Beginner level problems (5)
  • medium/ – Intermediate level problems (10)
  • hard/ – Advanced level problems (5)

Build Instructions

Use CMake to build each example.

Requirements

  • CMake 3.10+
  • C++17 or above
  • A C++ compiler like g++ or clang++

How to Build

cmake .
make

Run

Navigate to the specific executable and run:

./01_print_hello_from_threads

Cleaning the executables

make clean

Contributing Guidelines

We’re excited that you want to contribute to C++ Multithreading Practice 🚀 This repository is for learning, practicing, and sharing C++ multithreading concepts.

How to Contribute

  • Fork the repository on GitHub.
  • Clone your fork locally:
git clone https://github.com/<your-username>/cpp-multithreading.git
cd cpp-multithreading

Create a new branch:

git checkout -b my-feature-branch

Make your changes (add new problems, improve docs, fix bugs).

  • Commit and push:
git add .
git commit -m "Added: new multithreading problem"
git push origin my-feature-branch

Open a Pull Request on GitHub

Contribution Rules

  • Place new problems in the correct folder:
  • easy/ – Beginner level problems
  • medium/ – Intermediate level problems
  • hard/ – Advanced level problems

Use clear filenames like:

  • 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.

Code of Conduct

  • Be respectful and constructive.
  • Write clean and well-documented code.
  • Keep it beginner-friendly and easy to understand.

Getting Help

  • Found a bug? → Open an Issue
  • Have a suggestion? → Start a Discussion
  • Want to contribute code? → Submit a Pull Request

Thank you for helping improve C++ Multithreading Practice!

License

MIT License.

About

This repository contains categorized multithreading problems in C++. Each example includes commented code and explanations to help understand core multithreading concepts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Makefile 80.5%
  • C++ 9.1%
  • CMake 5.9%
  • C 4.1%
  • TypeScript 0.4%