Generating events with style
Matthieu Boutier (PPS), Gabriel Kerneis (PPS)

TL;DR
This paper explores automatic translation of threaded concurrent code into various event-driven styles using classical program transformations, demonstrating improved performance with lambda lifting in benchmarks.
Contribution
It introduces a systematic approach to generate diverse event-driven styles from threaded code through classical transformations like lambda lifting and environments.
Findings
Any event-driven style can be generated from threaded code using these transformations.
Lambda lifting generally outperforms environments in performance.
Transformations are implemented in CPC, an extension of C for concurrency.
Abstract
Threads and events are two common abstractions for writing concurrent programs. Because threads are often more convenient, but events more efficient, it is natural to want to translate the former into the latter. However, whereas there are many different event-driven styles, existing translators often apply ad-hoc rules which do not reflect this diversity. We analyse various control-flow and data-flow encodings in real-world event-driven code, and we observe that it is possible to generate any of these styles automatically from threaded code, by applying certain carefully chosen classical program transformations. In particular, we implement two of these transformations, lambda lifting and environments, in CPC, an extension of the C language for writing concurrent systems. Finally, we find out that, although rarely used in real-world programs because it is tedious to perform manually,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Distributed systems and fault tolerance · Logic, programming, and type systems
