# Async Action Group in Final Builder: Setting the Maximum Concurrent Threads Value Dynamically

**URL:** https://www.finalbuilder.com/forums/t/async-action-group-in-final-builder-setting-the-maximum-concurrent-threads-value-dynamically/1814
**Category:** Discussion
**Created:** [July 26, 2011, 2:19am UTC](https://www.finalbuilder.com/forums/t/async-action-group-in-final-builder-setting-the-maximum-concurrent-threads-value-dynamically/1814 "2011-07-26T02:19:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [July 26, 2011, 2:19am UTC](https://www.finalbuilder.com/forums/t/async-action-group-in-final-builder-setting-the-maximum-concurrent-threads-value-dynamically/1814/1 "2011-07-26T02:19:06Z")

</div>

Is it possible to change this value dynamically?

I want this value to be the same as the number of processors in the machine that the project is running.

&nbsp;

Thanks.

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [July 26, 2011, 4:09am UTC](https://www.finalbuilder.com/forums/t/async-action-group-in-final-builder-setting-the-maximum-concurrent-threads-value-dynamically/1814/2 "2011-07-26T04:09:13Z")

</div>

Hi,

&nbsp;

In Async Action Group there is a **MaxThreads** property.

The MaxThreads property can be changed dynamically with script.  
FB also has a variable called&nbsp; **NUMBER\_OF\_PROCESSORS** , containing the number of processors of current machine.

&nbsp;

Simply put one this line in Script Editor for a Async Group " **BeforeAction**":

- Python Script

**&nbsp; &nbsp; &nbsp;Action.MaxThreads = int(FBVariables["NUMBER\_OF\_PROCESSORS"])**

- Javascript

&nbsp; &nbsp; &nbsp; **Action.MaxThreads = FBVariables.NUMBER\_OF\_PROCESSORS**

- VBScript

**&nbsp; &nbsp; &nbsp;Action.MaxThreads = NUMBER\_OF\_PROCESSORS**

- PowerShell

&nbsp; &nbsp;&nbsp;**&nbsp;$Action.MaxThreads = $FBVariables["NUMBER\_OF\_PROCESSORS"]**

&nbsp;

Hope this helps.

&nbsp;

[![](upload://mXO98IxAjtoMPWCHP5H0fKWJhto.jpeg)](http://i.imgur.com/Azc2Y.jpg)

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [July 26, 2011, 7:42am UTC](https://www.finalbuilder.com/forums/t/async-action-group-in-final-builder-setting-the-maximum-concurrent-threads-value-dynamically/1814/3 "2011-07-26T07:42:38Z")

</div>

Thank You!
