# Returning values from another thread

**URL:** <https://forums.unrealengine.com/t/returning-values-from-another-thread/292025>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 25, 2014, 11:24pm UTC](https://forums.unrealengine.com/t/returning-values-from-another-thread/292025 "2014-08-25T23:24:01Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [August 28, 2014, 7:07pm UTC](https://forums.unrealengine.com/t/returning-values-from-another-thread/292025/3 "2014-08-28T19:07:56Z")

</div>

If you look at this section of my tutorial

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

The TArray is actually stored in the pc class, just avoid accessing it in the game thread until the other thread has finished filling it!

and never use ranged for loops when doing fancy stuff like this, use the standard for loop, so you check the length each time 🙂

Rama

---

_[View the full topic](https://forums.unrealengine.com/t/returning-values-from-another-thread/292025)._
