Cut object


Cut

This object clears the branch stack when it is executed. The branch stack is used for memorizing non parallel branches which are still to be executed.
Fig. 1: Functionality
The basic functionality is demonstrated in Fig. 1. At the branching the non-parallel sub branch is executed first and the execution of the other branch is memorized in the branch stack. The cut object clears the branch stack and so the other calculator object is never executed.

What can this be used for? A usage example is given in Fig. 2.
Fig. 2: Usage
Here depending on a condition two different calculator objects are executed within an endless loop. To prohibit the creation of an additional thread and wast cpu time the yes and no objects are connected with the condition via non-parallel sub branches. In this case it is not known, which of the two branches is executed first. As it is an endless loop, branches, which are memorized for execution may not be executed as the current branch never terminates. Therefore the branch stack may grow infinitely. Therefore the cut object can be used to clear the branch stack before the loop is executed again. The alternative way would be to use parallel branches to connect the yes / no objects.


The Vimms User Manual