main content

parallel pool of thread workers on the local machine -凯发k8网页登录

parallel pool of thread workers on the local machine

since r2020a

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

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, use and . for more information on future variables, see .

data types: fevalqueue

this property is read-only.

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

this property is read-only.

flag that indicates whether the thread pool is busy, specified as true or false. the pool is busy if there is outstanding work for the pool to complete.

object functions

shut down parallel pool
run function on parallel pool worker
execute function asynchronously on all workers in parallel pool

limitations

  • pools created using parpool('threads') and 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 .

version history

introduced in r2020a

网站地图