|
Re: Swerve VI based on the 2011 paper & excel by Ether
Just a quick comment on the difference between variables and wires.
A wire transfers a data value with sequencing. Variables transfer a data value without sequencing.
Another way to think of this is that wires do not have a value until they are written to. Once written to, the wire will propagate the value to all consumers, retaining it as long as necessary for the consumer to begin execution -- at which point it no longer has a value. Variables, global and local alike, have a value at all times. Before being written to, they have a default value. There is no waiting or sequencing. They always return their current value.
Another difference is that a wire can have only one writer and all other connections must be readers. Variables may have many writers, many readers.
Multiple writers and lack of expected sequencing are the cause of race conditions in parallel programming. Wires have neither of these issues.
As for determining the order of execution of code such as this. Since these are simple expressions, the LV clumping algorithm will turn each section of code into a series of instructions, there is no need for data flow scheduling for simple operations. Likewise, there are no loops, no asynchronous operations that would benefit from multiple cores. So the compiler will arbitrarily determine an order and the end result will be the same each time ... until the code is regenerated. Since you didn't specify any preference, the compiler is free to reorder the code according to memory optimizations, cache alignment, order that the code was written in, or phase of the moon.
Hope this helps.
Greg McKaskle
|