FlowPrioritize: A model-driven priority scheduling library for asynchronous rust runtimes
Modern online multiplayer games and real-time distributed APIs inherently process highly heterogeneous workloads. Lightweight, frequent tasks responsible for critical state synchronization constantly compete for compute resources against infrequent but throughput-heavy tasks, such as database persistence. Borrowing established terminology from network traffic analysis, we refer to these two classes as mouse tasks (small, latency-sensitive) and elephant tasks (large, throughput-oriented). Traditional First-In-First-Out (FIFO) queueing strategies inevitably cause mouse tasks to suffer from severe head-of-line blocking during traffic bursts. To resolve this, we present FlowPrioritize , an open-source Rust library built on the Tokio asynchronous runtime. Developers classify each submitted task as mouse or elephant; the library then abstracts the mixed workload as a formal M M c priority queue and handles all scheduling decisions automatically. A non-blocking telemetry thread calculates the Exponentially Weighted Moving Average (EWMA) of arrival and service rates, estimating the real-time system utilization ratio ( ρ ), defined as the ratio of total task arrival rate to aggregate service capacity. Based on ρ , the library dynamically applies non-preemptive strict priority to protect sub-millisecond tail latency for mouse tasks, and enforces active admission control during overloads ( ρ ≥ 1 ) to prevent system collapse.
Authors
- Kaiyi Zhuang
Institutions
- University of Toronto (CA)
Publication Details
- Journal
- SoftwareX
- Published
- 2026-06-09
- DOI
- https://doi.org/10.1016/j.softx.2026.102771
- Primary Topic
- Real-Time Systems Scheduling
- Type
- article
- Field-Weighted Citation Impact
- 0.00