# UnsafeParallelHashMap<TKey, TValue>.ParallelWriter

> A parallel writer for a NativeParallelHashMap.

## Definition

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

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

## Remarks

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

## Properties

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

## Methods

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