# NativeParallelHashMap<TKey, TValue>.ParallelWriter

> A parallel writer for a NativeParallelHashMap.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public struct NativeParallelHashMap<TKey, TValue>.ParallelWriter
```

## Remarks

Use [NativeParallelHashMap\<TKey, TValue>.AsParallelWriter](/engine/6000.7/script-reference/unity/collections/nativeparallelhashmap2/asparallelwriter.md) to create a parallel writer for a NativeParallelHashMap.

## Properties

| Property                                                                                                              | Description                                                       |
| --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [Capacity](/engine/6000.7/script-reference/unity/collections/nativeparallelhashmap2/parallelwriter/capacity.md)       | The number of key-value pairs that fit in the current allocation. |
| [ThreadIndex](/engine/6000.7/script-reference/unity/collections/nativeparallelhashmap2/parallelwriter/threadindex.md) | Returns the index of the current thread.                          |

## Methods

| Method                                                                                                      | Description                |
| ----------------------------------------------------------------------------------------------------------- | -------------------------- |
| [Add](/engine/6000.7/script-reference/unity/collections/nativeparallelhashmap2/parallelwriter/add.md)       | Adds a new key-value pair. |
| [TryAdd](/engine/6000.7/script-reference/unity/collections/nativeparallelhashmap2/parallelwriter/tryadd.md) | Adds a new key-value pair. |
