I have a NativeArray<int> where the index represents a hashed spatial position. I need to compute how many elements are in each cells, so jobs will write to the same index simultaneously.
My current solution is to make the array the expected table size * JobsUtility.ThreadIndexCount and use JobsUtility.ThreadIndex to know where to write in the array from the job(threadindex * tableSize + index). Once the job is complete, compile all the results.
Is there better solution?