Main Content

ThreadPool

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 as parfor or parfeval, run on the workers. With the ThreadPool object, you can interact with the parallel pool.

Creation

Create a parallel pool of thread workers on the local machine by using the parpool function.

pool = parpool("threads")

Properties

expand all

This property is read-only.

Number of thread workers comprising the parallel pool, specified as an integer.

Object Functions

deleteShut down parallel pool
parfevalExecute function asynchronously on parallel pool worker
parfevalOnAllExecute function asynchronously on all workers in parallel pool

For compatibility with process workers, the following object functions are also supported. You do not need to use them because data and file transfer is not necessary for pools of thread workers.

addAttachedFilesAttach files or folders to parallel pool
listAutoAttachedFilesList of files automatically attached to job, task, or parallel pool
ticBytesStart counting bytes transferred within parallel pool
tocBytesRead how many bytes have been transferred since calling ticBytes
updateAttachedFilesUpdate attached files or folders on parallel pool
Introduced in R2020a