Discovering C++ header dependencies

A multi-threaded solution to find dependencies in C++ files.

View code on GitHub


Description

Build a simple single-threaded solution to iteratively seach C++ files, searching for dependencies to include in header files. Significantly improved the speed through a multi-threaded approach.

Multi-threaded solution

To ensure thread-safety, I created two structs with correct locks and synchronization mechanisms in place. These measures were essential to prevent race conditions and maintain the integrity of data shared between multiple threads, allowing for smooth and efficient execution of the multi-threaded solution. The discoverdependencies.cpp creates the correct number of threads and calls the process function for each thread.