Rafael Echevarría

← Projects

Multithreaded search engine

2025

C++ · std::thread · mutex · condition_variable

Problem

Many users search several books at once. Premium users get priority without starving free users.

Design

Each user is a thread and each search fans out across sources. Scheduling splits priority 80/20, concurrency is bounded, and a dedicated thread handles balance top-ups. Synchronisation uses mutexes and condition variables.

premiumfree80 / 20threadthreadthread
Scheduling outline.