I'm going through the sample exam papers in advance of sitting the CLD-R.
I came across the reentrancy question shown below:
The answer is 4.
There is no specific mention of preallocation in a for loop in the documentation.
The "preallocating" means that for every call, we create a data space and clone for that call.
The above suggests the answer would be 6, there are six calls in total but the answer is 4. Does this mean that only one clone is assigned for a VI in a FOR loop?
Yes. The relevant term is "call site" and in the help you can find this:
Since the VI is in a single place in the code, it gets reused. This becomes very relevant when you write a VI which has useful state (like a feedback node) and then later you naively call it in a loop expecting each iteration of the loop to have its own copy with its own state, only to find that all the iterations share the same state.