Synchronous Programming with User-Level Threads in C∀

When computations cannot be satisfied immediately, programmers must use
one of two paradigms, Synchronous Programming and Asynchronous Programming.
This presentation discusses the benefits Synchronous Programming over
Asynchronous Programming and what requirements exist to use this paradigm.
It also discusses how C∀, a concurrent and backwards-compatible extension
of the C programming language, has powerful tools available for simple and
efficient Synchronous Programming. These tools include user-level threads
and high-level locking mechanisms which simply solve common problems.
Finally, the presentation shows different techniques to combine these
features with existing code to either uses blocking operations provided by
the kernel or is built according to an asynchronous paradigm.









C∀ is a polymorphic, non-object-oriented, concurrent, backwards-compatible
extension of the C programming language. This paper discusses the design
philosophy and implementation of its advanced control-flow and concurrent/parallel
features, along with the supporting runtime written in C∀. These features
are created from scratch as ISO C has only low-level and/or unimplemented
concurrency, so C programmers continue to rely on library features like pthreads.
C∀ introduces modern language-level control-flow mechanisms, like generators,
coroutines, user-level threading, and monitors for mutual exclusion and
synchronization. The runtime provides significant programmer simplification
and safety by eliminating spurious wakeup and monitor barging. The runtime
also ensures multiple monitors can be safely acquired simultaneously (deadlock free),
and this feature is fully integrated with all monitor synchronization mechanisms.
All control-flow features integrate with the C∀ polymorphic type-system and
exception handling, while respecting the expectations and style of C programmers.
Experimental results show comparable performance of the new features with similar
mechanisms in other concurrent programming languages.
KEYWORDS
generator, coroutine, concurrency, parallelism, thread, monitor, runtime, C, C∀ (Cforall)