On Tue, Oct 11, 2016 at 1:13 PM, Evan Fields
wrote:
> I'm unsure if "bit shared" is a technical term I should know, or if "bit
> shared" is a smartphone typo for "not shared" which would describe my
> understanding of normal loops, where it seems each iteration
I'm unsure if "bit shared" is a technical term I should know, or if "bit
shared" is a smartphone typo for "not shared" which would describe my
understanding of normal loops, where it seems each iteration doesn't have
access to loop-only variables defined in a previous iteration. :)
I guess the
On Oct 11, 2016 12:34 PM, "Evan Fields" wrote:
>
> 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)
>
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)