Inconsistent results when using Threads.@threads in a loop

The tuple version also shows the issue:

julia> function coefs(N)
           v = [ (0.0,0.0) for _ in 1:N]
           Threads.@threads for k in 1:N-1
               a = k
               b = k
               v[k+1] = (a,b)
           end
           a = 0.25
           b = 0.25
           v[1] = (a,b)
           return v
       end
coefs (generic function with 1 method)

julia> coefsA(10000)
10000-element Vector{Tuple{Float64, Float64}}:
 (0.25, 0.25)
 (1.0, 1.0)
 (2.0, 2.0)
 (3.0, 3.0)
 (4.0, 4.0)
 (5.0, 5.0)
 (6.0, 6.0)
 (7.0, 7.0)
 (8.0, 8.0)
 (9.0, 9.0)
 (10.0, 10.0)
 (11.0, 11.0)
 ⋮
 (2467.0, 9989.0)
 (9990.0, 9990.0)
 (9991.0, 9991.0)
 (9992.0, 9992.0)
 (9993.0, 9993.0)
 (9994.0, 9994.0)
 (9995.0, 9995.0)
 (9996.0, 9996.0)
 (9997.0, 9997.0)
 (6219.0, 9998.0)
 (9999.0, 9999.0)