Abstract
Process Interaction (PI) is a typical simulation strategy. Its traditional implementation is thread-based in which each thread is extended as an entity process. In this paper we discuss aspects of a coroutine-based PI simulation mechanism in C++. It provides a set of classes to implement entity processes, scheduling processes, resource management and data collecting. As C++ does not provide coroutine natively, we investigate implementing it by establishing additional libraries. We also present general benchmarks showing our coroutine implementation performance. At last a simple queuing example is given to evaluate our mechanism, which leads to a significant speedup over the thread-based approach.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Balci, O.: The Implementation of Four Conceptual Frameworks for Simulation Modeling in High-level Languages. In: Proceedings of the 20th Conference on Winter Simulation, pp. 287–295. ASM Press, California (1988)
Schwetman, H.: Object-Oriented Simulation Modeling with C++/CSIM17. In: Proceedings of the 1995 Winter Simulation Conference, pp. 529–533 (1995)
L’Ecuyer, P., Buist, E.: Simulation in Java with SSJ. In: Proceedings of the 2005 Winter Simulation Conference, pp. 611–620. IEEE Press, Orlando (2005)
Rossetti, M.D.: Java Simulation Library (JSL): An Open-Source Object-Oriented Library For Discrete-Event Simulation in Java. Int. J. Simulation and Process Modelling 4(1), 69–86 (2008)
Abdelhabib, B., Brahim, B.: JAPROSIM: A Java Framework for Discrete Event Simulation. Journal of Object Technology 7(1), 103–119 (2008)
L’Ecuyer, P., Meliani, L., Vaucher, J.: SSJ: A Framework for stochastic simulation in Java. In: Proceedings of the 2002 Winter Simulation Conference, pp. 234–242. IEEE Press, New Jersey (2002)
Jacobs, P.H.M., Verbraeck, A.: Single-Threaded Specification of Process-Interaction Formalism in Java. In: Proceedings of the 2004 Winter Simulation Conference, pp. 1548–1555. IEEE Press, New Jersey (2004)
Weatherly, R., Page, R.M.: Efficient Process Interaction Simulation in Java: Implementing Co-routines with A Single Java Thread. In: Proceedings of the 2004 Winter Simulation Conference, pp. 1437–1443. IEEE Press, New Jersey (2004)
Stadler, L., Würthinger, T., Wimmer, C.: Efficient coroutines for the java platform. In: Proceedings of the 8th International Conference on the Principles and Practice of Programming in Java, pp. 20–28. ACM Press, Vienna (2010)
Coroutine, http://en.wikipedia.org/wiki/Coroutine
Marzolla, M.: libcppsim: A Simula-like, Portable Process-Oriented Simulation Library in C++. In: Proceedings of ESM 2004, the 18th European Simulation Multiconference, Magdeburg, pp. 222–227 (2004)
Helsgaun, K.: A portable C++ library for coroutine sequencing. Datalogiske Skrifter (Writings on Computer Science) 87, Roskilde University (1999)
Martinez, J.C., Ioannou, P.G.: General-Purpose Systems for Effective Construction Simulation. Journal of Construction Engineering and Management 125(4), 265–276 (1999)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Xu, X., Li, G. (2012). Research on Coroutine-Based Process Interaction Simulation Mechanism in C++. In: Xiao, T., Zhang, L., Fei, M. (eds) AsiaSim 2012. AsiaSim 2012. Communications in Computer and Information Science, vol 325. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-34387-2_21
Download citation
DOI: https://doi.org/10.1007/978-3-642-34387-2_21
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-34386-5
Online ISBN: 978-3-642-34387-2
eBook Packages: Computer ScienceComputer Science (R0)