SMOOTH
Main (UI) thread — M/M/1 Worker pool — M/M/c Task executing Measured L_q vs theory (chart)

Frame-Budget Queueing Lab: M/M/1 vs M/M/c

Every mobile app balances the same trade-off: work done on the UI thread blocks the next frame, while work handed to a background thread pool runs in parallel without ever touching the screen. This lab models that trade-off with genuine queueing theory instead of a fixed-cost visualisation: tasks arrive as a Poisson process and each one's cost is drawn from an exponential distribution, so the main thread behaves as a textbook M/M/1 queue and the worker pool as an M/M/c queue with a single shared queue feeding c parallel servers. Live readouts show the closed-form theoretical utilization (ρ) and mean queue length (L_q, from the Erlang-C formula) side by side with the same quantities measured directly from the running simulation, so you can watch an empirical scheduler converge to its analytic prediction in real time — while a spinning app-icon freezes exactly when the main thread is busy, visualizing "jank" under the same 16.67 ms frame-budget arithmetic that GCD dispatch queues, Android Executors and Kotlin coroutine dispatchers are built around.