Hi, I have one question related to the multithreading calculation in Julia. It seems like the @threads for loop is not always safe to get what I want.
Here is one simple example of the code:
‘’’ julia
A = Any
B = Any @threads for i in -1000:1000
a = 0.001i
b = one vector + another vectora
push!(A, a)
push!(B, b)
end
‘’’
Then I found the length of A and B arrays are not equal to 2000. I am wondering what’s the reason for this, and how could we fix this issue. Thanks
Thank you. I tested Channel(), it definitely works, but the following issue is that it is very time consuming. I am wondering how could we improve the efficiency of Channel(). Thanks