Search Unity

Question What is the deal with NativeMultiHashMap and NativeMultiParallelHashMap?

Discussion in 'Entity Component System' started by TheOtherMonarch, Oct 13, 2022.

  1. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    866
    Last edited: Oct 13, 2022
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    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)
     
    Last edited: Oct 13, 2022
    apkdev, bb8_1, Antypodish and 4 others like this.