Abstract
In this paper, we introduce a Java library for actors integrated seamlessly with futures and supporting coroutines. Coroutines allow actors to suspend the execution of a message and possibly schedule other messages before resuming the suspended continuation. As such coroutines enhance actors as a major building block for constructing software components. The library is used together with a compiler to generate code from an application model into an executable program in Java. A formal description of the translation process is provided together with the most important library methods. We highlight the importance of having a scalable and efficient implementation by means of some typical benchmarks which model a large number of tasks, coroutines and actors.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
https://github.com/JaacRepo/JAAC push-mechanism branch.
- 2.
- 3.
In practice, running applications using tail-recursion are affected by the program’s memory limits due to the buildup of the program’s stack memory. The compiler of ABS into Java using the library, avoids this by converting tail-recursion into a set of spawned tasks representing each iteration of the loop.
- 4.
- 5.
References
Azadbakht, K., de Boer, F.S., Serbanescu, V.: Multi-threaded actors. In: Proceedings 9th Interaction and Concurrency Experience, ICE 2016, Heraklion, Greece, 8–9 June 2016, pp. 51–66 (2016). https://doi.org/10.4204/EPTCS.223.4
Boer, F.D., et al.: A survey of active object languages. ACM Comput. Surv. 50(5), 76:1–76:39 (2017). https://doi.org/10.1145/3122848
Clarke, D., Johnsen, E.B., Owe, O.: Concurrent objects à la carte. In: Dams, D., Hannemann, U., Steffen, M. (eds.) Concurrency, Compositionality, and Correctness. LNCS, vol. 5930, pp. 185–206. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-11512-7_12
Commons, A.: Javaflow. http://commons.apache.org/sandbox/javaflow
de Boer, F.S., Clarke, D., Johnsen, E.B.: A complete guide to the future. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 316–330. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-71316-6_22
Din, C.C., Bubel, R., Hähnle, R.: KeY-ABS: a deductive verification tool for the concurrent modelling language ABS. In: Felty, A.P., Middeldorp, A. (eds.) CADE 2015. LNCS (LNAI), vol. 9195, pp. 517–526. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21401-6_35
Flores-Montoya, A.E., Albert, E., Genaim, S.: May-happen-in-parallel based deadlock analysis for concurrent objects. In: Beyer, D., Boreale, M. (eds.) FMOODS/FORTE -2013. LNCS, vol. 7892, pp. 273–288. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-38592-6_19
Giachino, E., Laneve, C., Lienhardt, M.: A framework for deadlock detection in core ABS. Softw. Syst. Model. 15(4), 1013–1048 (2016)
Haller, P., Odersky, M.: Scala actors: unifying thread-based and event-based programming. Theor. Comput. Sci. 410(2), 202–220 (2009)
Imam, S.M., Sarkar, V.: Savina-an actor benchmark suite: enabling empirical evaluation of actor libraries. In: 4th International Workshop on Programming based on Actors Agents and Decentralized Control, pp. 67–80. ACM (2014)
Jangid, M.: Kotlin the unrivalled android programming language lineage. Imp. J. Interdiscip. Res. 3(8) (2017), http://imperialjournals.com/index.php/IJIR/article/view/5491
Johnsen, E.B., Hähnle, R., Schäfer, J., Schlatte, R., Steffen, M.: ABS: a core language for abstract behavioral specification. In: Aichernig, B.K., de Boer, F.S., Bonsangue, M.M. (eds.) FMCO 2010. LNCS, vol. 6957, pp. 142–164. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-25271-6_8
Kamburjan, E., Hähnle, R.: Uniform modeling of railway operations. In: Artho, C., Ölveczky, P.C. (eds.) FTSCS 2016. CCIS, vol. 694, pp. 55–71. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-53946-1_4
Kamburjan, E., Hähnle, R.: Deductive verification of railway operations. In: International Conference on Reliability, Safety and Security of Railway Systems, pp. 131–147. Springer (2017)
Schäfer, J.: A programming model and language for concurrent and distributed object-oriented systems. Ph.D. thesis, University of Kaiserslautern (2011)
Serbanescu, V., Nagarajagowda, C., Azadbakht, K., de Boer, F., Nobakht, B.: Towards type-based optimizations in distributed applications using ABS and JAVA 8. In: Pop, F., Potop-Butucaru, M. (eds.) ARMS-CC 2014. LNCS, vol. 8907, pp. 103–112. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-13464-2_8
Srinivasan, S., Mycroft, A.: Kilim: isolation-typed actors for java. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 104–128. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-70592-5_6
Storm, E.: Scala coroutines. http://storm-enroute.com/coroutines/
Taura, K., Matsuoka, S., Yonezawa, A.: ABCL/f: a future-based polymorphic typed concurrent object-oriented language - its design and implementation. In: Proceedings of the DIMACS Workshop on Specification of Parallel Algorithms, pp. 275–292. American Mathematical Society (1994)
Wong, P.Y.H., Albert, E., Muschevici, R., Proença, J., Schäfer, J., Schlatte, R.: The ABS tool suite: modelling, executing and analysing distributed adaptable object-oriented systems. Int. J. Softw. Tools Technol. Transf. 14(5), 567–588 (2012). https://doi.org/10.1007/s10009-012-0250-1
Yonezawa, A., Briot, J.-P., Shibayama, E.: Object-oriented concurrent programming in ABCL/1. In: Agha, G., Igarashi, A., Kobayashi, N., Masuhara, H., Matsuoka, S., Shibayama, E., Taura, K. (eds.) Concurrent Objects and Beyond. LNCS, vol. 8665, pp. 18–43. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-44471-9_2
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Switzerland AG
About this paper
Cite this paper
Serbanescu, V., Boer, F.d., Jaghoori, M.M. (2018). Actors with Coroutine Support in Java. In: Bae, K., Ölveczky, P. (eds) Formal Aspects of Component Software. FACS 2018. Lecture Notes in Computer Science(), vol 11222. Springer, Cham. https://doi.org/10.1007/978-3-030-02146-7_12
Download citation
DOI: https://doi.org/10.1007/978-3-030-02146-7_12
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-02145-0
Online ISBN: 978-3-030-02146-7
eBook Packages: Computer ScienceComputer Science (R0)