CPC: programming with a massive number of lightweight threads - Archive ouverte HAL Accéder directement au contenu
Communication Dans Un Congrès Année : 2011

CPC: programming with a massive number of lightweight threads

Gabriel Kerneis
  • Fonction : Auteur
  • PersonId : 857326
Juliusz Chroboczek
  • Fonction : Auteur
  • PersonId : 838639

Résumé

Threads are a convenient and modular abstraction for writing concurrent programs, but often fairly expensive. The standard alternative to threads, event-loop programming, allows much lighter units of concurrency, but leads to code that is difficult to write and even harder to understand. Continuation Passing C (CPC) is a translator that converts a program written in threaded style into a program written with events and native system threads, at the programmer's choice. Together with two undergraduate students, we taught ourselves how to program in CPC by writing Hekate, a massively concurrent network server designed to efficiently handle tens of thousands of simultaneously connected peers. In this paper, we describe a number of programming idioms that we learnt while writing Hekate; while some of these idioms are specific to CPC, many should be applicable to other programming systems with sufficiently cheap threads.
Fichier principal
Vignette du fichier
cpc-places-2011.pdf (48.71 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)
Loading...

Dates et versions

hal-00563369 , version 1 (04-02-2011)

Identifiants

Citer

Gabriel Kerneis, Juliusz Chroboczek. CPC: programming with a massive number of lightweight threads. PLACES'11, Apr 2011, Saarbrücken, Germany. pp. 30--34. ⟨hal-00563369⟩
144 Consultations
150 Téléchargements

Altmetric

Partager

Gmail Facebook X LinkedIn More