Let's say I have a type MyType and function f(mt::MyType) which is slow and 
stochastic. I have an object y::MyType, and I'd like to compute f(y) many 
times.

If I write a loop like 
fvals = Vector{Float64}(100)
Threads.@threads for i in 1:length(fvals)
  ycopy = deepcopy(y)
  fvals[i] = f(ycopy)
end

The various loop iterations are not interfering with each other, right? 
Each has its own copy of y?

Reply via email to