Skip to content

Instantly share code, notes, and snippets.

View schorg's full-sized avatar

Franz-Josef Grosch schorg

  • Darmstadt, Germany
View GitHub Profile
@schorg
schorg / sequential_concurrent.md
Last active April 1, 2020 20:45
Sequentially concurrent composition.

The code and discussion is related to the Blech example blinker

The follwing code - which is part of the main activity in the original example - sequentialises the concurrent execution of two activities in order to change the output blinkerLeverPos.

Although it is perfectly correct it is quite complicated. The sequential data-flow has to be organised explicitly.

activity monitorBlinkerLever(rotation: int32, blinkerLeverMove: int32)(blinkerLeverPos: int32)
    var movedBlinkerLeverPos: int32
 var localBlinkerLeverPos = blinkerLeverPos