Speculative Concurrent Processing with Transactional Memory in the Actor Model
The actor model has been successfully used for scalable computing in distributed systems. Actors are objects with a local state, which can only be modified by the exchange of messages. One of the fundamental principles of actor models is to guarantee sequential message processing, which avoids typical concurrency hazards, but limits the achievable message throughput. Preserving the sequential semantics of the actor model is, however, necessary for program correctness.
In this paper, we propose to add support for speculative concurrent execution in actors using transactional memory (TM). Our approach is designed to operate with message passing and shared memory, and can thus take advantage of parallelism available on distributed and multi-core systems. The processing of each message is wrapped in a transaction executed atomically and in isolation, but concurrently with other messages. This allows us (1) to scale while keeping the dependability guarantees ensured by sequential message processing, and (2) to further increase robustness of the actor model against threats due to the rollback ability that comes for free with transactional processing of messages. We validate our design within the Scala programming language and the Akka framework. We show that the overhead of using transactions is hidden by the improved message processing throughput, thus leading to an overall performance gain.
KeywordsConcurrency actors transactional memory speculative processing
Unable to display preview. Download preview PDF.
- 1.Hewitt, C., Bishop, P., Steiger, R.: A universal modular actor formalism for artificial intelligence. In: IJCAI 1973: Proceedings of the 3rd International Joint Conference on Artificial Intelligence, pp. 235–245 (1973)Google Scholar
- 2.Karmani, R.K., Shali, A., Agha, G.: Actor frameworks for the jvm platform: a comparative analysis. In: PPPJ 2009: Proceedings of the 7th International Conference on Principles and Practice of Programming in Java, pp. 11–20 (2009)Google Scholar
- 3.Haller, P.: On the integration of the actor model in mainstream technologies: the scala perspective. In: Proceedings of the 2nd Edition on Programming Systems, Languages and Applications Based on Actors, Agents, and Decentralized Control Abstractions, AGERE! 2012, pp. 1–6. ACM, Tucson (2012)Google Scholar
- 4.Imam, S.M., Sarkar, V.: Integrating task parallelism with actors. In: Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA 2012, Tucson, Arizona, USA, pp. 753–772 (2012)Google Scholar
- 6.Karmani, R.K., Agha, G.: Actors. In: Padua, D. (ed.) Encyclopedia of Parallel Computing, pp. 1–11. Springer (2011)Google Scholar
- 7.Goodman, D., Khan, B., Khan, S., Luján, M., Watson, I.: Software transactional memories for scala. Journal of Parallel and Distributed Computing (2012)Google Scholar
- 8.Harris, T., Larus, J., Rajwar, R.: Transactional Memory, 2nd edn. Morgan and Claypool Publishers (2010)Google Scholar
- 9.Scholliers, C., Tanter, E., Meuter, W.D.: Parallel actor monitors. In: SBLP 2010: 14th Brazilian Symposium on Programming Languages, Salvador, Brazil (2010)Google Scholar
- 10.ScalaSTM, http://nbronson.github.com/scala-stm/
- 11.Brito, A., Fetzer, C., Sturzrehm, H., Felber, P.: Speculative out-of-order event processing with software transaction memory. In: DEBS 2008: Proceedings of the International Conference on Distributed Event-Based Systems, pp. 265–275 (2008)Google Scholar