Features | Detailed Description
Available in VCL edition.
Many applications create threads that spend a great deal of time in the sleeping state, waiting for an event to occur. Other threads might enter a sleeping state only to be awakened periodically to poll for a change or update status information. Thread pooling enables you to use threads more efficiently by providing your application with a pool of worker threads that are managed by the system. One thread monitors the status of several wait operations queued to the thread pool. When a wait operation completes, a worker thread from the thread pool executes the corresponding callback function.
The most common members of the Thread Pool component can be seen below:
Name |
Description |
InitializeCOM |
Initializes the COM library in each working thread by using of both the CoInitialize and CoUninitialize functions. |
MaxThreadCount |
Gets or Sets the number of requests to the thread pool that can be active concurrently. All requests above that number remain queued until thread pool threads become available. |
MinThreadCount |
Gets or Sets the number of idle threads the clThreadPool maintains in anticipation of new requests. |
Name |
Description |
QueueWorkItem |
Queues a callback function for execution. The method executes when a thread pool thread becomes available. |
Stop |
Stops an execution of the currently active work items and cancels all queued items. |
Name |
Description |
OnCreateWorkerThread |
Occurs when a worker thread is created. |
OnFinishWorkItem |
Occurs when the work item is finished. |
OnQueueWorkItem |
Occurs when the work item is queued. |
OnRunWorkItem |
Occurs when the work item is run. |
|