AI-generated content but worth the effort...
This project is a C++20 re-creation of early Android AsyncTask ( SERIAL_EXECUTOR ) : background work runs strictly one task at a time in FIFO order on a dedicated worker thread, while UI/progress/completion callbacks are marshaled back to a main/UI thread loop so you don't race on UI state.
High-Level Architecture & Threading Model
There are two distinct threads in the application:
Main / UI Thread ( main.cpp + MainThreadLoop )
Background Worker Thread ( SerialExecutor )
A. SerialExecutor ( SerialExecutor.h / SerialExecutor.cpp )
FIFO Queue + Synchronization: Protects queue_ and stopping_ with a std::mutex , using std::condition_variable ( cv_ ) so the worker sleeps with zero CPU spin when idle and wakes immediately when a task arrives or shutdown begins.
Why std::deque ?…