docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct UnsafeParallelHashMapForSpatialHash<TKey, TValue>.ParallelWriter

    A parallel writer for a NativeParallelHashMap.

    Namespace: Infinity.Collections
    Assembly: solution.dll
    Syntax
    public struct UnsafeParallelHashMapForSpatialHash<TKey, TValue>.ParallelWriter
    Remarks

    Use AsParallelWriter() to create a parallel writer for a NativeParallelHashMap.

    Properties

    Capacity

    The number of key-value pairs that fit in the current allocation.

    Declaration
    public readonly int Capacity { get; }
    Property Value
    Type Description
    int

    The number of key-value pairs that fit in the current allocation.

    Methods

    UnsafeTryAdd(TKey, TValue, int)

    Adds a new key-value pair.

    Declaration
    public void UnsafeTryAdd(TKey key, TValue item, int m_ThreadIndex)
    Parameters
    Type Name Description
    TKey key

    The key to add.

    TValue item

    The value to add.

    int m_ThreadIndex
    Remarks

    当key存在时, 修改对应Value, key不存在时, 添加新的key-Value对, 多线程同时调用时, 不保证最终value值.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)