Premium
Advanced control‐flow and concurrency in C∀
Author(s) -
Delisle Thierry,
Buhr Peter A.
Publication year - 2021
Publication title -
software: practice and experience
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.437
H-Index - 70
eISSN - 1097-024X
pISSN - 0038-0644
DOI - 10.1002/spe.2925
Subject(s) - computer science , concurrency , posix threads , mutual exclusion , programming language , control flow , concurrency control , compiler , synchronization (alternating current) , programmer , concurrent object oriented programming , concurrent computing , deadlock , exception handling , non lock concurrency control , distributed computing , reactive programming , distributed concurrency control , programming paradigm , thread (computing) , inductive programming , computer network , channel (broadcasting) , database transaction
Summary C ∀ is a polymorphic, nonobject‐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 approaches 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 in a deadlock‐free way, 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.