simex simex simex | Reproducible C++ simulated exchange
实现订单网关、撮合引擎、持仓校验与行情发布模块,以交易阶段状态机驱动集合竞价和连续竞价。撮合引擎、订单网关和行情发布线程通过基于 std::atomic 的 SPSC 无锁队列传递数据;Linux epoll 与非阻塞 Socket 接收 TCP 订单请求,UDP 组播发布行情增量与订单簿快照。时间优先订单簿通过哈希表和双向链表实现 O(1) 价位索引、订单定位及节点摘除,并使用内存池预分配内存。项目使用 CMake / Ninja 构建,通过 GitHub Actions 执行 GCC、Clang 双编译器构建及 CTest 自动化测试。 實現訂單網關、撮合引擎、持倉校驗與行情發布模塊,以交易階段狀態機驅動集合競價和連續競價;使用 atomic SPSC 隊列、Linux epoll、非阻塞 Socket、UDP 組播、時間優先訂單簿和內存池,並通過 CMake / Ninja、GCC、Clang 與 CTest 驗證。 A C++20 simulated exchange with an order gateway, matching engine, position checks, and market-data publisher. A phase state machine drives auction and continuous matching; matching, gateway, and publishing threads communicate through atomic SPSC queues. Linux epoll and non-blocking sockets handle TCP orders, while UDP multicast publishes market-data deltas and order-book snapshots. A time-priority order book uses hash maps, linked lists, and a memory pool for constant-time operations. CMake/Ninja and GitHub Actions cover GCC, Clang, and CTest.