JA
jayDevCodes/cpp-multithreaded-file-search
A multithreaded file search tool built in C++ that searches text across multiple files in parallel.
C++ Multithreaded File Search ๐
A fast multithreaded file search tool written in C++ that searches for a word across multiple files simultaneously using threads.
Features
- Multithreaded file searching
- Fast text lookup across multiple files
- Simple CLI interface
- Lightweight and easy to compile
Project Structure
cpp-multithreaded-file-search
โ
โโโ main.cpp
โโโ search.cpp
โโโ search.h
โโโ file1.txt
โโโ file2.txt
โโโ file3.txt
Compilation
Compile the project using:
g++ main.cpp search.cpp -o search -pthread
Run the Program
./search
Then enter the word you want to search.
Example:
Enter word to search: hello
Output example:
file1.txt : Line 1 -> hello world
file2.txt : Line 2 -> hello from github
file3.txt : Line 3 -> hello again
Demo
Example output:
Running Program
Concepts Used
- C++ File Handling
- Multithreading (
std::thread) - Vector containers
- CLI programs
- Basic concurrency
Future Improvements
- Automatic folder scanning
- Regex search
- Colored terminal output
- Performance benchmarking
- Support for thousands of files
๐ค Contributing
Pull requests are welcome. Feel free to improve the project.

