PIP 5.5.3
Platform-Independent Primitives
Открытые члены | Полный список членов класса
Класс PIThreadPoolExecutor

Thread pools address two different problems: they usually provide improved performance when executing large numbers of asynchronous tasks, due to reduced per-task invocation overhead, and they provide a means of bounding and managing the resources, including threads, consumed when executing a collection of tasks. Подробнее...

Открытые члены

void execute (const std::function< void()> &runnable)
 Executes the given task sometime in the future. The task execute in an existing pooled thread. If the task cannot be submitted for execution, either because this executor has been shutdown or because its capacity has been reached. Подробнее...
 
void shutdown ()
 Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Invocation has no additional effect if already shut down. This method does not wait for previously submitted tasks to complete execution. Use awaitTermination to do that.
 

Подробное описание

Thread pools address two different problems: they usually provide improved performance when executing large numbers of asynchronous tasks, due to reduced per-task invocation overhead, and they provide a means of bounding and managing the resources, including threads, consumed when executing a collection of tasks.

Методы

◆ execute()

void PIThreadPoolExecutor::execute ( const std::function< void()> &  runnable)

Executes the given task sometime in the future. The task execute in an existing pooled thread. If the task cannot be submitted for execution, either because this executor has been shutdown or because its capacity has been reached.

Аргументы
runnablenot empty function for thread pool execution