for (int i = 0; i < list.size(); i++) {
thing = list.get(i)
print thing
branches[thing] = {
node {
print thing
}
}
parallel branches
As it's building the branches, it prints out each thing in the list in order as I would expect. When it actually
executes the branches, it prints the last thing in the list for as many items there are in the list. From what I understand, that's because it's executing the value of the external variable at the time the job is run, rather than what it was at the time the branch was built. Which I believe is the correct behavior, so I'm probably approaching this the wrong way.
What would be the correct way to run several parallel tasks on different items in a list? Is there a way to built the code block for each branch so it has the *value* of the variable when I'm building it rather than the *variable itself*?