# uproot.ThreadPoolExecutor

Defined in [uproot.source.futures](https://github.com/scikit-hep/uproot/blob/f1299d71fa4f435b1901386346c8a42adbd72642/src/uproot/source/futures.py) on [line 192](https://github.com/scikit-hep/uproot/blob/f1299d71fa4f435b1901386346c8a42adbd72642/src/uproot/source/futures.py#L192).

| **Inheritance order:**                                                                            |
|---------------------------------------------------------------------------------------------------|
| 1. [uproot.source.futures.Executor](uproot.source.futures.Executor.html.md)<br/>2. `abc.ABC` |

### *class* uproot.source.futures.ThreadPoolExecutor(max_workers: int | None = None)

* **Parameters:**
  * **max_workers** (*None* *or* *int*) – The maximum number of workers to start.
  * **workers.** (*In the current implementation this is exactly the number of*)
  * **None** (*If*)
  * **os.cpu_count****(****)****.** (*use*)

Like Python 3 `concurrent.futures.ThreadPoolExecutor` except that it has
only the subset of the interface Uproot needs.

The [uproot.source.futures.ResourceThreadPoolExecutor](uproot.source.futures.ResourceThreadPoolExecutor.html.md) extends this
class.

<a id="uproot-source-futures-threadpoolexecutor-max-workers"></a>

## max_workers

#### ThreadPoolExecutor.max_workers

The maximum number of workers.

<a id="uproot-source-futures-threadpoolexecutor-num-workers"></a>

## num_workers

#### ThreadPoolExecutor.num_workers

The number of workers.

<a id="uproot-source-futures-threadpoolexecutor-workers"></a>

## workers

#### ThreadPoolExecutor.workers

A list of workers ([uproot.source.futures.Worker](uproot.source.futures.Worker.html.md)).

<a id="uproot-source-futures-threadpoolexecutor-submit"></a>

## submit

Inherited from [uproot.source.futures.Executor](uproot.source.futures.Executor.html.md).

#### ThreadPoolExecutor.submit(task, /, \*args, \*\*kwargs)

Pass the `task`, `args`, and `kwargs` onto the workers’
[work_queue](uproot.source.futures.Worker.html.md#uproot-source-futures-worker-work-queue) as a
[uproot.source.futures.Future](uproot.source.futures.Future.html.md) so that it will be executed when
one is available.

<a id="uproot-source-futures-threadpoolexecutor-shutdown"></a>

## shutdown

Inherited from [uproot.source.futures.Executor](uproot.source.futures.Executor.html.md).

#### ThreadPoolExecutor.shutdown(wait: bool = True)

Stop every [uproot.source.futures.Worker](uproot.source.futures.Worker.html.md) by putting one None per
worker on the [work_queue](uproot.source.futures.Worker.html.md#uproot-source-futures-worker-work-queue) and
joining each worker thread.

<a id="uproot-source-futures-threadpoolexecutor-closed"></a>

## closed

Inherited from [uproot.source.futures.Executor](uproot.source.futures.Executor.html.md).

#### ThreadPoolExecutor.closed

True if [shutdown](#uproot-source-futures-threadpoolexecutor-shutdown) has
been started; False otherwise.
