Inconsistent results when using Threads.@threads in a loop

Then I suppose I remembered incorrectly and this was always how Julia behaved. Maybe the docs on the scoping rules can be more clear, a natural interpretation of “If x is already a local variable , then the existing local x is assigned” is using line order to determine what variable exists by a given line, but the whole local scope really exists at once.

2 Likes