Trying to code a parallel for loop with shared sparse arrays

One thing that you might consider is having each thread return its own sparse vector, and then process the vectors into a sparsematrix at the end. This will probably require more memory because it requires a dense vector of sparsevectors at the beginning, but it should allow you to thread.

Example:

v = Vector{SparseVector{UInt16}}(undef, 1000);

@Threads.threads for i = 1:1000
    v[i] = sparse(fill(UInt16(i), i))
end