Affiliation:
1. University of Pennsylvania, Philadelphia, PA
Abstract
This paper proposes to combine two seemingly opposed programming models for building massively concurrent network services: the event-driven model and the multithreaded model. The result is a hybrid design that offers the best of both worlds--the ease of use and expressiveness of threads and the flexibility and performance of events.
This paper shows how the hybrid model can be implemented entirely at the application level using
concurrency monads
in Haskell, which provides type-safe abstractions for both events and threads. This approach simplifies the development of massively concurrent software in a way that scales to real-world network services. The Haskell implementation supports exceptions, symmetrical multiprocessing, software transactional memory, asynchronous I/O mechanisms and application-level network protocol stacks. Experimental results demonstrate that this monad-based approach has good performance: the threads are extremely lightweight (scaling to ten million threads), and the I/O performance compares favorably to that of Linux NPTL. tens of thousands of simultaneous, mostly-idle client connections. Such massively-concurrent programs are difficult to implement, especially when other requirements, such as high performance and strong security, must also be met.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
18 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Semantics of RxJS;Proceedings of the 9th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems;2022-11-29
2. A concurrency model for JavaScript with cooperative cancellation;Proceedings of the 14th ACM SIGPLAN International Conference on Software Language Engineering;2021-10-17
3. Zeus: A resource allocation algorithm for the cloud of sensors;Future Generation Computer Systems;2019-03
4. Programming with event loops and control loops – From actors to agents;Computer Languages, Systems & Structures;2016-04
5. A continuation-based task programming model for C++: design of the Causeway library;Software: Practice and Experience;2016-02-26