Liberating Coroutines: Combining Sequential and Parallel Execution (2006)
BibTeX
@MISC{Dovland06liberatingcoroutines:,
author = {Steingrim Dovland},
title = {Liberating Coroutines: Combining Sequential and Parallel Execution},
year = {2006}
}
OpenURL
Abstract
Concurrent programming using threads is considered a hard and error-prone task. Coroutines are conceptually simpler, they are easier to program with due to their sequential nature. Flexible coroutines as presented by Belsnes and Østvold liberate classical coroutines from their quasi-parallel world and combine them with threads. This allows the programmer to factor programs into sequential and parallel tasks, leading to simpler programs. This thesis presents an extension to the formal semantics for flexible coroutines. A detailed breakdown of the scheduling strategies and parameter passing is presented in the same formal framework. Some words are given on patterns that emerge when programming with flexible coroutines and these patterns are defined in the formal framework. We present a clean implementation of flexible coroutines in Java, based on standard threads and semaphores. Challenges encountered, such as representing coroutines in Java and invoking methods across threads are







