function f1()
x = zeros(10000)
Threads.@threads for i in 1:100000 #typo causes BoundsError
x[i] = 2.0 * i
end
return x
end
f1()
returns x
with values from 2 up to 20000 and prints Error thrown in threaded loop on thread 0: BoundsError(a=Array{Float64, (10000,)}[2, 4, 6, ...
But:
function f2()
x = zeros(10000)
for i in 1:100000 #typo causes BoundsError
x[i] = 2.0 * i
end
return x
end
f2()
simply throws the error and does not return.
Is there a rationale behind this behavior or is this a bug? My thinking is that the behavior should be identical.