Is there some that let me safely write values from different jobs?
Anything with AsParallellWriter
NativeQueue
Native[Multi]HashMap
NativeStream
Well, my knowledge of C++ STL is a bit rusty, but NativeMultiHashMap is like an array where indexes can be repeated? Sounds like the kind of data structure I need right now.
NativeHashMap : Dictionary<Key, Value>
NativeMultiHashMap : Dictionary<Key, List>
NativeHash is like a NativeDictionary?
NativeHashMap<TKey, TValue> is a replacement for Dictionary<TKey, TValue>
Indexes are not repeat but you can store multiple values under the same index in a List. TryGetFirstValue() and TryGetNextValue() should be used.
Technically they repeat. If you look at source code (TryGetFirstValueAtomic\TryGetNextValueAtomic) it has pointer to keys array and next iteration of TryGetNextValueAtomic “grows” entryIdx from next pointer, thus in keys array key can repeat, and this is why you get duplicates if you call GetKeyArray on NMHM.