FlowPrioritize: A model-driven priority scheduling library for asynchronous rust runtimes
作者:Kaiyi Zhuang · 发表于:SoftwareX · 年份:2026 · DOI:10.1016/j.softx.2026.102771 · 研究领域:Real-Time Systems Scheduling、Network Traffic and Congestion Control、Peer-to-Peer Network Technologies
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.