Loading…

A closer look at process-based simulation with stackless coroutines

Validating discrete-event computer simulations for a particular problem domain often involves the help of a domain expert. This means that a certain structural closeness between the simulator’s inner workings and the modeled system is needed in order to allow the expert to follow the implementation...

Full description

Saved in:
Bibliographic Details
Published in:Information and software technology 2022-01, Vol.141, p.106695, Article 106695
Main Authors: Weber, Dorian, Wiesner, Paula, Fischer, Joachim
Format: Article
Language:English
Subjects:
Citations: Items that this one cites
Items that cite this one
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:Validating discrete-event computer simulations for a particular problem domain often involves the help of a domain expert. This means that a certain structural closeness between the simulator’s inner workings and the modeled system is needed in order to allow the expert to follow the implementation in analogy. Process-based simulation imposes an object-oriented view onto a modeled system which allows for a high degree of structural closeness in most cases. In comparison, event-based simulation requires a procedural definition with a relatively low degree of structural closeness for many cases, but outperforms the process-based approach both in terms of performance and portability. Recent advances in compiler technology have introduced a portable way of rewriting thread-based code into event-based code, effectively providing the means to implement portable green-threads in compiled system languages. This work aims to cover the historical, mechanical, and implementation specific aspects as well as practical measurements of runtime performance of a library based solution to process-based discrete-event simulation in comparison to alternative solutions. We explain how to use the stackless coroutines introduced into the Rust programming language to implement a minimal simulator core and discuss aesthetic as well as performance implications through systematic benchmarking using the three simulation scenarios Barbershop, Car Ferry and Dining Philosophers by comparing their implementations to equivalent ones in the simulation language SLX and the C++ library ODEMx. Our results indicate that stackless coroutines enable structurally equivalent formulations to pure process-based simulations while still delivering close to equivalent or – depending on the use-case – even superior performance and portability compared to the aforementioned solutions. We show that stackless coroutines can be used to bridge the gap between process- and event-based simulators, affording modelers a level of abstraction close to the former approach while delivering the performance and portability of the latter one.
ISSN:0950-5849
1873-6025
DOI:10.1016/j.infsof.2021.106695