I mean I want to use 1 thread for each condition, so maybe for loop is not appropriate. If that’s the case, I am looking for an alternative way to solve this.
only one of those blocks of code actually runs, determined by the condition.
julia> if true
println("A")
elseif true
println("B")
else
println("C")
end
A
julia> if false
println("A")
elseif true
println("B")
else
println("C")
end
B
julia> if false
println("A")
elseif false
println("B")
else
println("C")
end
C
There’s no notion of parallelizing an if statement, because multiple things aren’t being run
Ohh, if the OP is trying to multithread the loop, then yes you can do that. I think I just misunderstood what they were asking for originally, sorry for the noise @iangilan.