ThreadPool Methods |
The ThreadPool type exposes the following members.
| Name | Description | |
|---|---|---|
| FetchWorkerAndExecuteWork |
Tries to fetch a worker, if this fails (because the thread pool is depleted) -1 is returned.
Otherwise, a worker starts executing the given task, and its internal thread id is returned.
| |
| SetPoolSize |
Tries to set the pool size to numThreads for doing work.
Returns the number of threads really set, which may be lower due to a lower number of processors available.
Only to be called once.
| |
| WaitForWorkDone |
Waits until the thread of the given internal thread id completed executing its task
|