Hello Maladie.
Action in Antescofo are launched in parallel. So the print “this is the end”
is launched simultaneously with the loop
.
If you want to trigger the print at the end of the loop, you can use the +=>
continuation operator:
loop myloop 15ms
{
$first := $first + 1
print $first
}
until ($first = 15)
+=>
print "This is the end"
The construction
-
a b
launches actions a
and b
simultaneously
<li><code>a 5 b</code> launches actions <code>b</code> 5 beats after the start of <code>a</code> </li>
<li><code>a => b</code> launches actions <code>b</code> at the end of <code>a</code> </li>
<li><code>a +=> b</code> launches actions <code>b</code> at the end of <code>a</code> and its children (a process is a example of compound action that span children actions: for hese compound actions, the end of the action does not coincide necessarily with the end of all derived actions). </li>
Some comments on simultaneity in Antescofo: the language follows the synchronous hypothesis used in the development of real-time embedded systems assuming that computations occurring at the same date are performed in a specific and well defined order. This hypothesis may seem odd at first sight: one has to postulate instantaneous action, i.e. actions that take no time to be performed, to make possible a sequence of actions all occurring at the same date.
But the success of the synchronous hypothesis in the field of real-time systems demonstrate the usefulness of this hypothesis: at a certain abstraction level, we may assume that an action takes no time to be performed (i.e. the execution time is negligible at this abstraction level) and relying on a sequential execution model (the sequence of actions is performed in a specific and well determined order) leads to a deterministic and predictable behavior.
For example, the following program
print 1
print 2
triggers the two prints in the same instant, in parallel. However, in the instant, the print
are atomic action. There execution are well ordered and follows the order of appearance in the score. The net result is that the two print do not mixe and 1
is always printed before 2
, as expected.