Why Do Scala Developers Mix the Actor Model with other Concurrency Models?

  • Samira Tasharofi
  • Peter Dinges
  • Ralph E. Johnson
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7920)

Abstract

Mixing the actor model with other concurrency models in a single program can break the actor abstraction. This increases the chance of creating deadlocks and data races—two mistakes that are hard to make with actors. Furthermore, it prevents the use of many advanced testing, modeling, and verification tools for actors, as these require pure actor programs. This study is the first to point out the phenomenon of mixing concurrency models by Scala developers and to systematically identify the factors leading to it. We studied 15 large, mature, and actively maintained actor programs written in Scala and found that 80% of them mix the actor model with another concurrency model. Consequently, a large part of real-world actor programs does not use actors to their fullest advantage. Inspection of the programs and discussion with the developers reveal two reasons for mixing that can be influenced by researchers and library-builders: weaknesses in the actor library implementations, and shortcomings of the actor model itself.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Agha, G.: Actors: a model of concurrent computation in distributed systems. MIT Press, Cambridge (1986)Google Scholar
  2. 2.
    Agha, G.A., Mason, I.A., Smith, S.F., Talcott, C.L.: A foundation for actor computation. J. Funct. Program. 7(1), 1–72 (1997)MathSciNetMATHCrossRefGoogle Scholar
  3. 3.
    Armstrong, J.: Making reliable distributed systems in the presence of software errors. PhD thesis, Kungl Tekniska Högskolan (2003), http://www.erlang.org
  4. 4.
    Atkinson, R., Hewitt, C.: Synchronization in actor systems. In: Proc. of the 4th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL 1977, pp. 267–280 (1977)Google Scholar
  5. 5.
    Bonér, J., Klang, V., Kuhn, R., et al.: Akka library, http://akka.io
  6. 6.
    Bradbury, J.S., Jalbert, K.: Defining a catalog of programming anti-patterns for concurrent Java. In: Proc. of the 3rd International Workshop on Software Patterns and Quality, SPAQu 2009, pp. 6–11 (October 2009)Google Scholar
  7. 7.
    Bykov, S., Geller, A., Kliot, G., Larus, J.R., Pandya, R., Thelin, J.: Orleans: cloud computing for everyone. In: Proc. of the 2nd ACM Symposium on Cloud Computing, SOCC 2011, pp. 16:1–16:14 (2011)Google Scholar
  8. 8.
    Dedecker, J., Van Cutsem, T., Mostinckx, S., D’Hondt, T., De Meuter, W.: Ambient-oriented programming. In: Companion to the 20th Annual ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA 2005, pp. 31–40 (2005)Google Scholar
  9. 9.
    Dinges, P., Agha, G.: Scoped synchronization constraints for large scale actor systems. In: Sirjani, M. (ed.) COORDINATION 2012. LNCS, vol. 7274, pp. 89–103. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  10. 10.
    Dolby, J., Fink, S.J., Sridharan, M.: T. J. Watson libraries for analysis (WALA), http://wala.sf.net
  11. 11.
    Haller, P., Sommers, F.: Actors in Scala. Artima Series (2012)Google Scholar
  12. 12.
    Haller, P., Van Cutsem, T.: Implementing joins using extensible pattern matching. In: Lea, D., Zavattaro, G. (eds.) COORDINATION 2008. LNCS, vol. 5052, pp. 135–152. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  13. 13.
    Hewitt, C., Bishop, P., Steiger, R.: A universal modular actor formalism for artificial intelligence. In: Proc. of the 3rd International Joint Conference on Artificial Intelligence, IJCAI 1973, pp. 235–245 (1973)Google Scholar
  14. 14.
    Hochstein, L., Shull, F., Reid, L.B.: The role of MPI in development time: a case study. In: Proc. of the 2008 ACM/IEEE Conference on Supercomputing, SC 2008, pp. 34:1–34:10 (2008)Google Scholar
  15. 15.
    Imam, S.M., Sarkar, V.: Integrating task parallelism with actors. In: Proc. of the ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA 2012, pp. 753–772 (2012)Google Scholar
  16. 16.
    Karmani, R.K., Shali, A., Agha, G.: Actor frameworks for the JVM platform: a comparative analysis. In: Proc. of the 7th International Conference on Principles and Practice of Programming in Java, PPPJ 2009, pp. 11–20 (2009)Google Scholar
  17. 17.
    Lauterburg, S., Dotta, M., Marinov, D., Agha, G.: A framework for state-space exploration of Java-based actor programs. In: Proc. of the 2009 IEEE/ACM International Conference on Automated Software Engineering, ASE 2009, pp. 468–479 (2009)Google Scholar
  18. 18.
    Lu, S., Park, S., Seo, E., Zhou, Y.: Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. SIGPLAN Not. 43(3), 329–339 (2008)CrossRefGoogle Scholar
  19. 19.
    Luff, M.: Empirically investigating parallel programming paradigms: A null result. In: PLATEAU at the ACM Onward! Conference (2009)Google Scholar
  20. 20.
    Mattson, T., Sanders, B., Massingill, B.: Patterns for parallel programming, 1st edn. Addison-Wesley Professional (2004)Google Scholar
  21. 21.
    Nanz, S., Torshizi, F., Pedroni, M., Meyer, B.: Design of an empirical study for comparing the usability of concurrent programming languages. In: Proc. of the 2011 International Symposium on Empirical Software Engineering and Measurement, ESEM 2011, pp. 325–334 (2011)Google Scholar
  22. 22.
    Negara, S., Karmani, R.K., Agha, G.: Inferring ownership transfer for efficient message passing. In: Proc. of the 16th ACM Symposium on Principles and Practice of Parallel Programming, PPoPP 2011, pp. 81–90 (2011)Google Scholar
  23. 23.
    Odersky, M., Spoon, L., Venners, B.: Programming in Scala, 2/e. Artima Series. Artima Press (2010)Google Scholar
  24. 24.
    Okur, S., Dig, D.: How do developers use parallel libraries? In: Proc. of the ACM SIGSOFT 20th International Symposium on the Foundations of Software Engineering, FSE 2012, pp. 54:1–54:11 (2012)Google Scholar
  25. 25.
    Pankratius, V., Schmidt, F., Garretón, G.: Combining functional and imperative programming for multicore software: an empirical study evaluating Scala and Java. In: Proc. of the 2012 International Conference on Software Engineering, ICSE 2012, pp. 123–133 (2012)Google Scholar
  26. 26.
    Pech, V., König, D., Winder, R., et al.: GPars, http://gpars.codehaus.org/
  27. 27.
    Proença, J., Clarke, D., de Vink, E., Arbab, F.: Dreams: a framework for distributed synchronous coordination. In: Proc. of the 27th Annual ACM Symposium on Applied Computing, SAC 2012, pp. 1510–1515 (2012)Google Scholar
  28. 28.
    Schäfer, J., Poetzsch-Heffter, A.: JCoBox: Generalizing active objects to concurrent components. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 275–299. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  29. 29.
    Scholliers, C., Tanter, E., Meuter, W.D.: Parallel actor monitors. In: 14th Brazilian Symposium on Programming Languages (2010)Google Scholar
  30. 30.
    Sirjani, M., Jaghoori, M.M.: Ten years of analyzing actors: Rebeca experience. In: Agha, G., Danvy, O., Meseguer, J. (eds.) Formal Modeling: Actors, Open Systems, Biological Systems. LNCS, vol. 7000, pp. 20–56. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  31. 31.
    Song, M., Ren, S.: Coordination operators and their composition under the actor-role-coordinator (ARC) model. SIGBED Rev. 8(1), 14–21 (2011)MathSciNetCrossRefGoogle Scholar
  32. 32.
    Tasharofi, S., Gligoric, M., Marinov, D., Johnson, R.: Setac: A framework for phased deterministic testing of Scala actor programs. In: The Second Scala Workshop (2011)Google Scholar
  33. 33.
    Tasharofi, S., Karmani, R.K., Lauterburg, S., Legay, A., Marinov, D., Agha, G.: TransDPOR: A novel dynamic partial-order reduction technique for testing actor programs. In: Giese, H., Rosu, G. (eds.) FMOODS/FORTE 2012. LNCS, vol. 7273, pp. 219–234. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  34. 34.
    Torres, W., Pinto, G., Fernandes, B., Oliveira, J.A.P., Ximenes, F.A., Castor, F.: Are Java programmers transitioning to multicore?: a large scale study of Java FLOSS. In: SPLASH Workshops, SPLASH 2011 Workshops, pp. 123–128 (2011)Google Scholar
  35. 35.
    Yonezawa, A. (ed.): ABCL: an object-oriented concurrent system. MIT Press, Cambridge (1990)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Samira Tasharofi
    • 1
  • Peter Dinges
    • 1
  • Ralph E. Johnson
    • 1
  1. 1.Department of Computer ScienceUniversity of Illinois at Urbana–ChampaignUSA

Personalised recommendations