Continuation-passing C, compiling threads to events through continuations

From MaRDI portal
Publication:1929338

DOI10.1007/S10990-012-9084-5zbMATH Open1256.68038arXiv1011.4558OpenAlexW3101187860MaRDI QIDQ1929338FDOQ1929338

Gabriel Kerneis, Juliusz Chroboczek

Publication date: 8 January 2013

Published in: Higher-Order and Symbolic Computation (Search for Journal in Brave)

Abstract: 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.


Full work available at URL: https://arxiv.org/abs/1011.4558





Cites Work


Cited In (1)

Uses Software






This page was built for publication: Continuation-passing C, compiling threads to events through continuations

Report a bug (only for logged in users!)Click here to report a bug for this page (MaRDI item Q1929338)