C++20 Framework QB Runs REST APIs and Market-Data Pipelines on One Engine
The QB framework is a C++20 actor-based runtime that allows fundamentally different programs — such as a REST API with Redis caching and a lock-free market-data pipeline — to run under identical execution rules without any configuration changes. The framework assigns each worker thread its own event loop and a set of actors, meaning mutable state is always owned by exactly one thread, eliminating the need for mutexes on actor fields. Inter-thread communication happens exclusively through lock-free mailboxes, and the entire engine contains only two locks: one for service-ID registration at startup and one for parking idle threads. Actor addresses are encoded as 32-bit identifiers carrying both service and core routing information, so message dispatch requires no hash lookups or registries. The underlying async runtime, qb-io, is also designed as a standalone layer built on libev, supporting coroutines, TCP/UDP/SSL, QUIC, and timers independently of the actor system.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in