About this question

Low-Latency Order Signal

Easy · concurrency · Quant Developer interview question · concurrency, semaphore, c++17, multithreading

The Order Matching Engine (OME) and Risk Management system are often separated in low-latency trading systems into distinct threads to maximize throughput while maintaining data integrity. Efficient signaling mechanisms, such as binary semaphores, are essential to coordinate these components in a lockstep fashion without inducing race conditions or deadlocks. Task Implement a BinarySemaphore class using std::mutex and std::condition_variable to facilitate strict synchronization between a produc