当前位置: X-MOL 学术Inf. Softw. Technol. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
A closer look at process-based simulation with stackless coroutines
Information and Software Technology ( IF 3.8 ) Pub Date : 2021-07-31 , DOI: 10.1016/j.infsof.2021.106695
Dorian Weber 1 , Paula Wiesner 1 , Joachim Fischer 1
Affiliation  

Context

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.

Objective

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.

Method

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.

Results

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.

Conclusion

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.



中文翻译:

使用无堆栈协程仔细研究基于进程的模拟

语境

验证特定问题域的离散事件计算机模拟通常需要领域专家的帮助。这意味着模拟器的内部工作和建模系统之间需要一定的结构紧密度,以便让专家能够以类比方式跟踪实现。基于过程的仿真将面向对象的视图强加到建模系统上,这在大多数情况下允许高度的结构紧密度。相比之下,在许多情况下,基于事件的仿真需要具有相对较低的结构紧密度的过程定义,但在性能和可移植性方面都优于基于过程的方法。编译器技术的最新进展引入了一种将基于线程的代码重写为基于事件的代码的可移植方式,

客观的

这项工作旨在涵盖历史、机械和实现的特定方面,以及与替代解决方案相比,基于库的解决方案对基于流程的离散事件模拟的运行时性能的实际测量。

方法

我们解释了如何使用引入Rust编程语言的无堆栈协程来实现最小的模拟器核心,并通过使用三个模拟场景BarbershopCar FerryDining Philosophers的系统基准测试,通过将它们的实现与等效的实现进行比较来讨论美学和性能影响在模拟语言SLXC ++ODEMx 中

结果

我们的结果表明,与上述解决方案相比,无堆栈协程能够实现与纯基于过程的模拟在结构上等效的公式,同时仍然提供接近等效的或 - 取决于用例 - 甚至更高的性能和便携性。

结论

我们展示了无堆栈协程可用于弥合基于流程和基于事件的模拟器之间的差距,为建模者提供接近前一种方法的抽象级别,同时提供后一种方法的性能和可移植性。

更新日期:2021-08-15
down
wechat
bug