Skip to main content

Research on Coroutine-Based Process Interaction Simulation Mechanism in C++

  • Conference paper
AsiaSim 2012 (AsiaSim 2012)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 325))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)

    Google Scholar 

  2. Schwetman, H.: Object-Oriented Simulation Modeling with C++/CSIM17. In: Proceedings of the 1995 Winter Simulation Conference, pp. 529–533 (1995)

    Google Scholar 

  3. 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)

    Chapter  Google Scholar 

  4. 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)

    Article  Google Scholar 

  5. Abdelhabib, B., Brahim, B.: JAPROSIM: A Java Framework for Discrete Event Simulation. Journal of Object Technology 7(1), 103–119 (2008)

    Article  Google Scholar 

  6. 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)

    Google Scholar 

  7. 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)

    Google Scholar 

  8. 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)

    Google Scholar 

  9. 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)

    Google Scholar 

  10. Coroutine, http://en.wikipedia.org/wiki/Coroutine

  11. 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)

    Google Scholar 

  12. Helsgaun, K.: A portable C++ library for coroutine sequencing. Datalogiske Skrifter (Writings on Computer Science) 87, Roskilde University (1999)

    Google Scholar 

  13. Martinez, J.C., Ioannou, P.G.: General-Purpose Systems for Effective Construction Simulation. Journal of Construction Engineering and Management 125(4), 265–276 (1999)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics