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 | Execute 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.
Version History
Introduced in R2020a