This project is a Linux-oriented CSV processing pipeline written in C++ that shows practical use of operating systems concepts and systems-level programming. It combines multi-process orchestration, inter-process communication, synchronization, and multi-threaded work distribution to transform raw financial tick data into structured reports.
The implementation reflects C++ proficiency through RAII-friendly resource handling, STL-based aggregation, thread-safe coordination, and clear separation of responsibilities across the pipeline stages.
- Process management through
fork()/exec()coordination and child reaping. - IPC using FIFOs, shared memory, and named semaphores.
- Concurrency with a worker thread pool and bounded buffering.
- Careful cleanup of OS resources on normal exit and interruption.
- Practical C++ design for parsing, aggregation, and reporting.
dispatcher: creates FIFO/shared memory/semaphore, forks+execs children, handles signals, reaps children, and performs IPC cleanup.ingester: scans input directory for CSV files and sends chunked records through FIFO.processor: reads chunks from FIFO, runs a worker thread pool, aggregates financial tick metrics, writes result to shared memory.reporter: waits on named semaphore, reads shared memory, generatesreport.txtandreport.csv.
src/: C++ sources for the pipeline stages and shared definitions.Makefile: builds the four executables.run.sh: wrapper script that builds the project, launches the dispatcher, and summarizes the run.data/sample.csv: sample input file for local runs.DECLARATION.txt: project declaration file.logs/,output/, andreport/: runtime or submission artifacts that are not meant to be committed.
Each CSV row is expected as:
symbol,price,volume
Aggregation per symbol:
- VWAP = sum(price * volume) / sum(volume)
- High
- Low
- Total Volume
- Total Records
makeCompiler flags:
g++ -std=c++17 -Wall -Wextra -pthreadThe run.sh wrapper checks for g++ and make before launching the pipeline.
chmod +x run.sh
./run.sh -i input -o output -n 4 -q 8Options:
-iinput directory with.csvfiles-ooutput directory-nnumber of worker threads-qqueue size for bounded buffer-cclean build/output artifacts-hhelp
output/report.txt: human-readable report written viadup()/dup2()stdout redirection.output/report.csv: machine-readable summary.logs/*.log: per-process logs from child stdout/stderr redirection.
These directories are generated at runtime and are ignored by Git.
On normal exit or interruption, the pipeline cleans:
- FIFO path in
/tmp - POSIX shared memory object
- POSIX named semaphore
No zombies are left because dispatcher reaps all children with waitpid().