title: Julia Threads.@threads doesn't work in a simple example
body: <p>I am running a double loop in Julia. The code is quite simple. </p>
  
  <pre><code>w = rand(1000,1000)
  function regular_demo(w::Array{Float64, 2})
      n = size(w)[1]
      G = zeros(n,n)
      @inbounds for j in 1:n-1
      wjj = w[j, j]
          for i in j+1:n
              wii = w[i, i]
              wij = w[i, j]
              sum = wii + 2wij + 3wjj 
              sum_inverse = inv(sum)
              G[j,j] = G[j,j] + sum_inverse
              G[i,i] = G[i,i] + sum_inverse
              G[i,j] = G[i,j] - sum_inverse
              G[j,i] = G[j,i] - sum_inverse         
          end
      end
  G
  end
  regular_demo(w)
  </code></pre>
  
  <pre><code>function thread_demo(w::Array{Float64, 2})
      n = size(w)[1]
      G = zeros(n,n)
      @inbounds Threads.@threads for j in 1:n-1
      wjj = w[j, j]
          for i in j+1:n
              wii = w[i, i]
              wij = w[i, j]
              sum = wii + 2wij + 3wjj 
              sum_inverse = inv(sum)
              G[j,j] = G[j,j] + sum_inverse
              G[i,i] = G[i,i] + sum_inverse
              G[i,j] = G[i,j] - sum_inverse
              G[j,i] = G[j,i] - sum_inverse         
          end
      end
  G
  end
  thread_demo(w)
  </code></pre>
  
  <p>The only difference between regular_demo(w) and thread_demo(w) is @inbounds Threads.@threads in line 4 of the function. If I run both regular_demo(w) and thread_demo(w) for the same matrix w. The output matrix G are different. How can I implement thread in thread_demo(w) for the purpose of getting the same output matrix G as regular_demo(w). </p>