# Concurrency

## Overview

Prism supports concurrency via the `concurrency` keyword argument in the [`PrismProject`](https://docs.runprism.com/fundamentals/prismproject-api) class. This variable tells Prism how many workers should execute the project.

The default value for `concurrency` is `1`. This means that only one worker is used to execute the tasks in the Prism project, and so non-dependent tasks cannot be run in parallel.

Setting `concurrency = 2` will allow Prism to use two worker processes to execute the tasks. This means that two tasks can be run simultaneously (assuming that those two tasks are not dependent on one another). For example:

<figure><img src="https://content.gitbook.com/content/Wa61PGua12LWQwN9QnPA/blobs/iXvccgH9bDayY1tgFZ81/concurrency.png" alt=""><figcaption><p>Concurrency example.</p></figcaption></figure>

For maximum concurrency, you can set `THREADS = os.cpu_count()`:

```python
# example_project.py

import os

from prism.client import PrismProject

project = PrismProject(concurrency=os.cpu_count())
```
