Continuation-Passing C, compiling threads to events through continuations - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Pré-Publication, Document De Travail Année : 2010

Continuation-Passing C, compiling threads to events through continuations

Juliusz Chroboczek
  • Fonction : Auteur
  • PersonId : 838639

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 complete 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 significantly cheaper, as the most efficient thread libraries available.
Fichier principal
Vignette du fichier
hosc.pdf (440.44 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)

Dates et versions

inria-00537964 , version 1 (19-11-2010)
inria-00537964 , version 2 (14-02-2012)
inria-00537964 , version 3 (05-07-2012)

Identifiants

  • HAL Id : inria-00537964 , version 1
  • ARXIV : 1011.4558

Citer

Gabriel Kerneis, Juliusz Chroboczek. Continuation-Passing C, compiling threads to events through continuations. 2010. ⟨inria-00537964v1⟩

Collections

PPS
178 Consultations
902 Téléchargements

Altmetric

Partager

Gmail Facebook X LinkedIn More