# ParallelFor loop to update thousands of instances in HierarchicalInstancedStaticMeshComponent

**URL:** <https://forums.unrealengine.com/t/parallelfor-loop-to-update-thousands-of-instances-in-hierarchicalinstancedstaticmeshcomponent/413709>\
**Category:** Asset Creation\
**Tags:** static-mesh-disappea, Instanced-Mesh, unreal-engine, multiple-instance, CPP, question\
**Created:** [January 4, 2018, 5:16am UTC](https://forums.unrealengine.com/t/parallelfor-loop-to-update-thousands-of-instances-in-hierarchicalinstancedstaticmeshcomponent/413709 "2018-01-04T05:16:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Infiltrator](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Infiltrator](https://forums.unrealengine.com/u/Infiltrator)\
**Post date:** [January 4, 2018, 5:16am UTC](https://forums.unrealengine.com/t/parallelfor-loop-to-update-thousands-of-instances-in-hierarchicalinstancedstaticmeshcomponent/413709/1 "2018-01-04T05:16:43Z")

</div>

How can I use ParallelFor loop to update instance static meshes ? I have asked this question even on forums with some details : [link text](https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1407848-parallelfor-loop-to-update-thousands-of-instances-in-hierarchicalinstancedstaticmeshcomponent)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [January 4, 2018, 1:32pm UTC](https://forums.unrealengine.com/t/parallelfor-loop-to-update-thousands-of-instances-in-hierarchicalinstancedstaticmeshcomponent/413709/2 "2018-01-04T13:32:59Z")

</div>

This guide: [A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums](https://wiki.unrealengine.com/Multi-Threading:_Task_Graph_System)

Says this:

“Please note that a task graph will sometimes use the game thread, and therefore for large tasks you should use a FRunnable as demonstrated in my other multi threading wiki.”

The “other multi threading wiki” is here: [A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums](https://wiki.unrealengine.com/Multi-Threading:_How_to_Create_Threads_in_UE4)

---

<div class="post-metadata">

**Author:** ![Infiltrator](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Infiltrator](https://forums.unrealengine.com/u/Infiltrator)\
**Post date:** [January 4, 2018, 3:42pm UTC](https://forums.unrealengine.com/t/parallelfor-loop-to-update-thousands-of-instances-in-hierarchicalinstancedstaticmeshcomponent/413709/3 "2018-01-04T15:42:44Z")

</div>

Hi Jin\_VE, I understand that, but I dont think its a async task or threading issue alone here, it has something to do with how the Hierarchical Static Instanced Mesh Component does the updating. Thanks for the pointers though, I will try to test it but as I said I think the real issue is how the update instances are designed.

---

<div class="post-metadata">

**Author:** ![Infiltrator](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Infiltrator](https://forums.unrealengine.com/u/Infiltrator)\
**Post date:** [January 9, 2018, 3:51am UTC](https://forums.unrealengine.com/t/parallelfor-loop-to-update-thousands-of-instances-in-hierarchicalinstancedstaticmeshcomponent/413709/4 "2018-01-09T03:51:22Z")

</div>

See the answer posted here by @timtimmy : [ParallelFor loop to update thousands of instances in HierarchicalInstancedStaticMeshComponent ? - C++ Programming - Unreal Engine Forums](https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1407848-parallelfor-loop-to-update-thousands-of-instances-in-hierarchicalinstancedstaticmeshcomponent) .
