Scheduling-independent threads and exceptions in SHIM

Olivier Tardieu, Stephen A. Edwards
2006 Proceedings of the 6th ACM & IEEE International conference on Embedded software - EMSOFT '06  
Concurrent programming languages should be a good fit for embedded systems because they match the intrinsic parallelism of their architectures and environments. Unfortunately, typical concurrent programming formalisms are prone to races and nondeterminism, despite the presence of mechanisms such as monitors. In this paper, we propose SHIM, the core of a deterministic concurrent language, meaning the behavior of a program is independent of the scheduling of concurrent operations. SHIM does not
more » ... ns. SHIM does not sacrifice power or flexibility to achieve this determinism. It supports both synchronous and asynchronous paradigms-loosely and tightly synchronized threads-the dynamic creation of threads and shared variables, recursive procedures, and exceptions. We illustrate our programming model with examples including breadth-first-search algorithms and pipelines. By construction, they are race-free. We provide the formal semantics of SHIM and a preliminary implementation. Hardware/software codesign, Deterministic model of computation e ::= L | V | op 1 e | e op 2 e | ( e ) expressions s ::= V = e; | P( (V (,V ) * )? ); statements | { b * } | if ( e ) s else s | while ( e ) s | s par s | next V ; | try s catch( E ) s | throw E; b ::= T V ; | s block statements d ::= T V | T &V parameter declarations p ::= void P( (d(, d) * )? ) { b * } procedure declarations m ::= p * void main() { b * } programs L denotes literals, T types (e.g., int, void), E exceptions, V variables, and P procedures. par binds most tightly.
doi:10.1145/1176887.1176908 dblp:conf/emsoft/TardieuE06 fatcat:o6cpk5nd4rhm7a7ookuz5vgssq