Home > lambdatheultimate > Continuation-Passing C: Compiling threads to events through continuations

Continuation-Passing C: Compiling threads to events through continuations

December 6th, 2010 12:53 admin Leave a comment Go to comments

Gabriel Kerneis and Juliusz Chroboczek, “Continuation-Passing C: Compiling threads to events through continuations”, arXiv: 1011.4558.

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.

See also the CPC website.

Source: Continuation-Passing C: Compiling threads to events through continuations

Related Articles:

  1. Compiling Structural Types on the JVM
  2. A Monadic Framework for Delimited Continuations
  3. Ask Slashdot: Going Beyond Comment Threads?
  4. Gross But Cool: Weaving Blood Vessels with Threads of Human Tissue
  5. Yield : Mainstream Delimited Continuations; “yield” from different languages compared and formalized
blog comments powered by Disqus
YOYOYOOYOYOYO