# NativeParallelHashSet<T>.ParallelWriter

> A parallel writer for a NativeParallelHashSet.

## Definition

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

```csharp
public struct NativeParallelHashSet<T>.ParallelWriter
```

## Remarks

Use [NativeParallelHashSet\<T>.AsParallelWriter](/engine/6000.7/script-reference/unity/collections/nativeparallelhashset1/asparallelwriter.md) to create a parallel writer for a set.

## Properties

| Property                                                                                                        | Description                                              |
| --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| [Capacity](/engine/6000.7/script-reference/unity/collections/nativeparallelhashset1/parallelwriter/capacity.md) | The number of values that fit in the current allocation. |

## Methods

| Method                                                                                                      | Description                                                                                                                                                                     |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Add](/engine/6000.7/script-reference/unity/collections/nativeparallelhashset1/parallelwriter/add.md)       | Adds a new item. If the item is already present in the collection, this method **should** throw, but currently does not! Instead, it returns false without replacing said item. |
| [TryAdd](/engine/6000.7/script-reference/unity/collections/nativeparallelhashset1/parallelwriter/tryadd.md) | Adds a new value. If the item is already present, this method returns false without replacing said item.                                                                        |
