Process-Based Simulation with Stackless Coroutines
Dorian Weber, Joachim Fischer · 2020
Computer simulations are useful tools to predict and test accumulated knowledge about the behavior of complex systems. The use of process-based simulators has historically been established in combination with object-oriented languages and requires stackful coroutines for their execution. This approach delivers excellent performance if the compiler has a built-in coroutine-concept that is translated into machine code directly. Languages without this feature move their implementations of coroutines into libraries which typically use OS-dependent calls or non-portable assembly to implement them and perform worse than the direct approach.