302 articles – 345 references  [version française]
HAL: hal-00135160, version 1

Detailed view  Export this paper
Continuation-passing for C: a space-efficient implementation of concurrency
Juliusz Chroboczek 1
(2006-03-03)

Threads are a convenient abstraction for programming concurrent systems. They are however expensive, which leads many programmers to use coarse-grained concurrency where a fine-grained structure would be preferable, or use more cumbersome implementation techniques. Cooperative threads can be easily implemented in a language that provides {\em first-class continuations}. Unfortunately, CPS conversion, the standard technique for adding continuations to a language, is not natural for typical imperative languages. This paper defines a notion of CPS conversion for the C programming language. Continuation Passing C (CPC) is a concurrent extension of C with very cheap threads. It is implemented as a series of source-to-source transformations, including CPS conversion, that convert a threaded program in direct style into a purely sequential C program. In this paper, we describe CPC and the transformations that are used in its implementation.
1:  Preuves, Programmes et Systèmes (PPS)
CNRS : UMR7126 – Université Paris VII - Paris Diderot
Cognitive science/Computer science
Continuations – C programming language – concurrency – CPS
Attached file list to this document: 
PDF
cpc.pdf(123.3 KB)