ThreadPool - Parallel pool of thread workers on the local machine - MATLAB (original) (raw)

Main Content

Parallel pool of thread workers on the local machine

Description

Use parpool to create a parallel pool of thread workers on your local machine. After you create the pool, parallel pool features, such asparfor or parfeval, run on the workers. With theThreadPool object, you can interact with the parallel pool.

Creation

Properties

expand all

This property is read-only.

Flag that indicates whether the thread pool is busy, returned astrue or false. The pool is busy if there is outstanding work for the pool to complete.

This property is read-only.

Queue of FevalFuture objects to run on the thread pool, returned as a FevalQueue object. You can use this property to check the pending and running future variables of the parallel pool. To create future variables, useparfeval and parfevalOnAll. For more information on future variables, see Future.

Data Types: FevalQueue

Store of files accessible to both client and workers, returned as a FileStore object.

This property is read-only.

Number of thread workers comprising the parallel pool, returned as an integer. You can specify the number of thread workers during pool creation with parpool.

Store of data accessible to both client and workers, returned as a ValueStore object.

Since R2025a

This property is read-only.

Information about workers comprising the parallel pool, returned as an array ofparallel.Worker objects.

Object Functions

Composite Create and access nondistributed variables on multiple workers from client
delete Shut down parallel pool
parfeval Run function on parallel pool worker
parfevalOnAll Run function asynchronously on all workers in parallel pool
partition Partition parallel pool
parforOptions Options set for parfor
spmd Execute code in parallel on workers of parallel pool

Limitations

Version History

Introduced in R2020a

expand all

To identify the workers in a pool, use the Workers property.