2021:Thread Pool (Object)

From Grooper Wiki
Revision as of 15:58, 26 December 2019 by Configadmin (talk | contribs) (Created page with "Thread Pools allow Grooper to allocate system resources to different Unattended Activities. New Grooper Repositories initialize with a sin...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Thread Pools allow Grooper to allocate system resources to different Unattended Activities. New Grooper Repositories initialize with a single Thread Pool named "Default". In many cases, this is sufficient to run all activities. However, one can alter how many threads are allocated to an activity in a Batch Process.  This is done by creating a new Thread Pool, assigning it to an Activity Processing Grooper Service from Grooper Config, and specifying the Thread Pool on that activity's Batch Process Step properties. 

For example, some activities only allow one instance of the activity to execute at a time per machine executing the activity. In such case, you would first create a new Thread Pool, specifying a "PerMachine" Concurrency Mode. Then, you would create an Activity Processing service, assign it the newly created Thread Pool and drop the number of available threads to one. Last, you would configure the activity's step in the Batch Process to run on the newly created Thread Pool instead of the Default. By doing this, the activity will be forced to run on a single thread, one instance at a time. If another instance of that activity tries to run while the first is running (such as a second batch running on the same machine trying to run the same activity already running in another Batch Process), the second will be forced to wait its turn.