Search Unity

NativeMultiHashMap.GetUnsafeBucketData Example Usage in a Job

Discussion in 'Entity Component System' started by addent, Jun 5, 2020.

  1. addent

    addent

    Joined:
    Apr 27, 2019
    Posts:
    35
    IJobNativeMultiHashMapMergedSharedKeyIndices was deprecated and the changelog says that the new NativeMultiHashMap.GetUnsafeBucketData can be used instead.

    I looked in the ECS examples and could not find anything.

    Does anyone have an example of how to use NativeMultiHashMap.GetUnsafeBucketData?
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,685
    Just open NativeHashMap.cs and look at deprecated interfaces, as they all use GetUnsafeBucketData. Change log suggest you - copy that implementation if you want to use them. Or write your own if required, as it just thread-safe buckets of data. Each bucket can be processed concurrently with other buckets, and all key/value pairs in each bucket must be processed individually (in sequential order) by a single thread.
    upload_2020-6-6_2-1-57.png