ThreadPool
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
Object Functions
delete | Shut down parallel pool |
parfeval | Run function on parallel pool worker |
parfevalOnAll | Run function asynchronously on all workers in parallel pool |
Limitations
Pools created using
parpool('Threads')
andbackgroundPool
are both thread-based pools which utilize the same resources. It is possible that activity on one pool may block activity on the other and vice versa. Additionally, persistent data and random number generation stream state are shared in between these pools. For more information on controlling random number streams, see Control Random Number Streams on Workers.Not all functionality is supported in a thread-based environment. For details on specific limitations, see Check Thread Supported Functions.
Version History
Introduced in R2020a