Abstract
We propose a model for event-oriented programming under shared memory based on access permissions with explicit parallelism. In order to obtain safe parallelism, programmers need to specify the variable permissions of functions. Blocking operations are non existent, and callback-based APIs are used instead, which can be called in parallel for different events as long as the access permissions are guaranteed. This model scales for both IO and CPU-bounded programs.
We have implemented this model in the Eve language, which includes a compiler that generates parallel tasks with synchronization on top of variables, and a work-stealing runtime that uses the epoll interface to manage the event loop.
We have also evaluated that model in micro-benchmarks in programs that are either CPU-intensive or IO-intensive with and without shared data. In CPU-intensive programs, it achieved results very close to multithreaded approaches. In the share-nothing IO-intensive benchmark it outperformed all other solutions. In shared-memory IO-intensive benchmark it outperformed other solutions with a more or equal value of writes than read operations.
Chapter PDF
Similar content being viewed by others
References
Dabek, F., Zeldovich, N., Kaashoek, F., Mazieres, D., Morris, R.: Event-driven programming for robust software. In: Proceedings of the 10th Workshop on ACM SIGOPS European Workshop, pp. 186–189. ACM (2002)
Krohn, M.N., Kohler, E., Kaashoek, M.F.: Events can make sense. In: USENIX Annual Technical Conference, pp. 87–100 (2007)
Ousterhout, J.: Why threads are a bad idea (for most purposes). Presentation given at the 1996 Usenix Annual Technical Conference, vol. 5 (1996)
von Behren, J.R., Condit, J., Brewer, E.A.: Why events are a bad idea (for high-concurrency servers). In: HotOS, pp. 19–24 (2003)
Haller, P., Odersky, M.: Scala actors: Unifying thread-based and event-based programming. Theoretical Computer Science 410(2), 202–220 (2009)
Blumofe, R.D., Joerg, C.F., Kuszmaul, B.C., Leiserson, C.E., Randall, K.H., Zhou, Y.: Cilk: An efficient multithreaded runtime system, vol. 30. ACM (1995)
Frigo, M., Leiserson, C.E., Randall, K.H.: The implementation of the cilk-5 multithreaded language. SIGPLAN Not. 33(5), 212–223 (1998)
Kumar, V., Frampton, D., Blackburn, S.M., Grove, D., Tardieu, O.: Work-stealing without the baggage. SIGPLAN Not. 47(10), 297–314 (2012)
Hamilton, J.: The cost of latency (2009), http://perspectives.mvdirona.com/2009/10/31/TheCostOfLatency.asp
Lehmann, M.A.: Benchmarking libevent against libev (2011), http://libev.schmorp.de/bench.html/ (online; accessed August 31, 2013)
Voellmy, A., Wang, J., Hudak, P., Yamamoto, K.: Mio: A high-performance multicore io manager for ghc
Thadani, M.N., Khalidi, Y.A.: An efficient zero-copy I/O framework for UNIX. Citeseer (1995)
Eggers, S.J., Katz, R.H.: The effect of sharing on the cache and bus performance of parallel programs. SIGARCH Comput. Archit. News 17(2), 257–270 (1989)
Von Behren, R., Condit, J., Zhou, F., Necula, G.C., Brewer, E.: Capriccio: scalable threads for internet services. ACM SIGOPS Operating Systems Review 37(5), 268–281 (2003)
Li, P., Zdancewic, S.: Combining events and threads for scalable network services implementation and evaluation of monadic, application-level concurrency primitives. ACM SIGPLAN Notices 42(6), 189–199 (2007)
O’Sullivan, B., Tibell, J.: Scalable i/o event handling for ghc. ACM Sigplan Notices 45, 103–108 (2010)
Zeldovich, N., Yip, A., Dabek, F., Morris, R., Mazieres, D., Kaashoek, M.F.: Multiprocessor support for event-driven programs. In: USENIX Annual Technical Conference, General Track, pp. 239–252 (2003)
Gaud, F., Geneves, S., Lachaize, R., Lepers, B., Mottet, F., Muller, G., Quéma, V.: Efficient workstealing for multicore event-driven systems. In: 2010 IEEE 30th International Conference on Distributed Computing Systems (ICDCS), pp. 516–525. IEEE (2010)
Stork, S., Marques, P., Aldrich, J.: Concurrency by default: using permissions to express dataflow in stateful programs. In: Proceedings of the 24th ACM SIGPLAN Conference Companion on Object Oriented Programming Systems Languages and Applications, pp. 933–940. ACM (2009)
Bonetta, D., Ansaloni, D., Peternier, A., Pautasso, C., Binder, W.: Node.Scala: Implicit parallel programming for high-performance web services. In: Kaklamanis, C., Papatheodorou, T., Spirakis, P.G. (eds.) Euro-Par 2012. LNCS, vol. 7484, pp. 626–637. Springer, Heidelberg (2012)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer International Publishing Switzerland
About this paper
Cite this paper
Fonseca, A., Rafael, J., Cabral, B. (2014). Eve: A Parallel Event-Driven Programming Language. In: Lopes, L., et al. Euro-Par 2014: Parallel Processing Workshops. Euro-Par 2014. Lecture Notes in Computer Science, vol 8806. Springer, Cham. https://doi.org/10.1007/978-3-319-14313-2_15
Download citation
DOI: https://doi.org/10.1007/978-3-319-14313-2_15
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-14312-5
Online ISBN: 978-3-319-14313-2
eBook Packages: Computer ScienceComputer Science (R0)