What is the deal with NativeMultiHashMap and NativeMultiParallelHashMap?

Is NativeMultiHashMap going to be become NativeMultiParallelHashMap? In the docs for the new collections package it has NativeMultiParallelHashMap and NativeMultiHashMap seems to be gone, but still exist in the package. NativeMultiParallelHashMap does not current exist in the package.

https://docs.unity3d.com/Packages/com.unity.collections@2.1/manual/collection-types.html

from what i understand it was probably bit of a mistake renaming NativeMultiParallelHashMap to NativeMultiHashMap.

They added a new variant, NativeHashMap which is an optimized version of NativeParallelHashMap for use when you only need it on a single thread (created in a job for example.)

They will probably rename the current NativeMultiHashMap to NativeMultiParallelHashMap and add a fast single thread variant to to replace NativeMultiHashMap at some point as well.

So TLDR currently

Single Thread Variants

  • NativeHashMap
  • NativeHashSet

Multi Thread Variants

  • NativeParallelHashMap
  • NativeParallelHashSet
  • NativeMultiHashMap (oops!)

(it should probably be called NativeParallelMultiHashMap and it’s inside the file NativeParallelMultiHashMap.cs)

8 Likes