tpool
tpool::create ?-minworkers N? ?-maxworkers N? ?-idletime S? ?-initcmd SCRIPT? ?-exitcmd SCRIPT?
Thread pools: a group of worker threads that run jobs. tpool::post gives a job and gets a job id, and tpool::wait and tpool::get give the results.
This page also has tpool::cancel, tpool::create, tpool::get, tpool::names, tpool::post, tpool::preserve, tpool::release, tpool::resume, tpool::suspend, tpool::wait.
Subcommands
| Synopsis | What it does |
|---|---|
tpool::create ?OPTIONS? |
A new pool, and its id. |
tpool::post ?-detached? ?-nowait? POOL SCRIPT |
Gives a job to the pool, and its job id. |
tpool::wait POOL JOBLIST ?VAR? |
Waits for one job of the list to end, and gives the ids of the jobs that ended. |
tpool::get POOL JOB |
The result of a job that ended. |
tpool::cancel POOL JOBLIST ?VAR? |
Removes jobs that have not started. |
tpool::suspend POOL |
Stops the start of new jobs. tpool::resume starts them again. |
tpool::preserve POOL |
Adds a reference. tpool::release removes one. |
tpool::names |
The ids of the pools. |
Facts
- Capability:
thread. A new interpreter does not have this command. See Limits and capabilities. - Compute cost: one compute unit for the call, and more for the commands that it runs.