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

jayDevCodes/cpp-multithreaded-file-search | GitHunt