inria-00537964, version 3
Continuation-Passing C: compiling threads to events through continuations
Gabriel Kerneis 1Juliusz Chroboczek
1
Higher-Order and Symbolic Computation 24, 3 (2011) 239-279
Résumé : In this paper, we introduce Continuation Passing C (CPC), a programming language for concurrent systems in which native and cooperative threads are unified and presented to the programmer as a single abstraction. The CPC compiler uses a compilation technique, based on the CPS transform, that yields efficient code and an extremely lightweight representation for contexts. We provide a proof of the correctness of our compilation scheme. We show in particular that lambda-lifting, a common compilation technique for functional languages, is also correct in an imperative language like C, under some conditions enforced by the CPC compiler. The current CPC compiler is mature enough to write substantial programs such as Hekate, a highly concurrent BitTorrent seeder. Our benchmark results show that CPC is as efficient, while using significantly less space, as the most efficient thread libraries available.
- 1 : Preuves, Programmes et Systèmes (PPS)
- CNRS : UMR7126 – Université Paris VII - Paris Diderot
- Domaine : Informatique/Langage de programmation
- Mots-clés : Concurrent programming – Lambda-lifting – Continuation-Passing Style
- Commentaire : The final publication is available at www.springerlink.com.
- Versions disponibles : v1 (20-11-2010) v2 (20-02-2012) v3 (05-07-2012)
- inria-00537964, version 3
- http://hal.inria.fr/inria-00537964
- oai:hal.inria.fr:inria-00537964
- Contributeur : Gabriel Kerneis
- Soumis le : Jeudi 5 Juillet 2012, 16:26:19
- Dernière modification le : Lundi 15 Octobre 2012, 19:31:22