# Maximum number of parallel processes

**URL:** https://www.finalbuilder.com/forums/t/maximum-number-of-parallel-processes/1156
**Category:** Discussion
**Created:** [March 24, 2009, 4:13am UTC](https://www.finalbuilder.com/forums/t/maximum-number-of-parallel-processes/1156 "2009-03-24T04:13:40Z")
**Posts on this page:** 4
**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: [March 24, 2009, 4:13am UTC](https://www.finalbuilder.com/forums/t/maximum-number-of-parallel-processes/1156/1 "2009-03-24T04:13:40Z")

</div>

Hi

Is there a way to set "Maximum number of parallel processes"?

For example, I have an async action group that runs&nbsp;3 processes. Each process is an async action group that run&nbsp;3 processes. I.e, I now run 9 processes in parallel.

But, if I, for example, only want to run a total amount of&nbsp;5 processes in parallel at any time - is there a way to set this for the whole project?

The reason I ask is that there would be nice to let different machines run the same FB projects, but with different levels of parallelism, depending on their number of CPU's for example.

&nbsp;

Regards,

Magnus

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [March 25, 2009, 1:16am UTC](https://www.finalbuilder.com/forums/t/maximum-number-of-parallel-processes/1156/2 "2009-03-25T01:16:10Z")

</div>

Hi Magnus   
  
 No, unfortunately not. Due to the hierarchical nature of FinalBuilder projects it would be difficult to enforce this. You could however add some level of control over it in your project. On XP and Vista, there is an environment variable : NUMBER\_OF\_PROCESSORS which might help you decide how to contol the number of processes you start.   
  
 You can set the MaxThreads property of the Async Group action in script at runtime, so perhaps you could do something like :   
  
 Action.MaxThreads = NUMBER\_OF\_PROCESSORS   
  
 on the top level group   
  
 and   
  
 Action.MaxThreads = NUMBER\_OF\_PROCESSORS / 3   
  
 on each of the bottom level groups.   
  
 This is something I would like to investigate for a future version though… I often see projects where the async action group is abused with people run a lot of processes in parallel and it would be good to have some project wide control over this (perhaps by using a project wide thread pool).   
  
 HTH

---

<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: [May 5, 2009, 2:41am UTC](https://www.finalbuilder.com/forums/t/maximum-number-of-parallel-processes/1156/3 "2009-05-05T02:41:20Z")

</div>

Hi Vincent

Thank you for your reply. I&nbsp;am not sure I&nbsp;understand where to put this line:

Action.MaxThreads = NUMBER\_OF\_PROCESSORS

&nbsp;

Regards,

Magnus

&nbsp;

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [May 6, 2009, 2:12am UTC](https://www.finalbuilder.com/forums/t/maximum-number-of-parallel-processes/1156/4 "2009-05-06T02:12:44Z")

</div>

In the Action’s BeforeAction Script event.
