# Thread safe way to save/load data to/from disk in async task?

**URL:** <https://forums.unrealengine.com/t/thread-safe-way-to-save-load-data-to-from-disk-in-async-task/451511>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 30, 2019, 9:28pm UTC](https://forums.unrealengine.com/t/thread-safe-way-to-save-load-data-to-from-disk-in-async-task/451511 "2019-06-30T21:28:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![superdreamgen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@superdreamgen](https://forums.unrealengine.com/u/superdreamgen)\
**Post date:** [July 15, 2019, 9:00am UTC](https://forums.unrealengine.com/t/thread-safe-way-to-save-load-data-to-from-disk-in-async-task/451511/2 "2019-07-15T09:00:03Z")

</div>

I will leave some notes about my findings here in case anyone else tries to solve this problem.

So far, running FFileHelper functions in an Async Task to save data to disk is working great. I haven’t run into any race conditions or experienced any crashes. I am passing the Async Task a reference to a bool that it sets true when beginning work and sets false when done, which is checked in the calling function to prevent it from running the save to disk task again before the first task finishes.

You can learn more about how to use an Async Task here:

> **[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...

Will post another update if I run into problems with this method and/or come up with something better.

---

_[View the full topic](https://forums.unrealengine.com/t/thread-safe-way-to-save-load-data-to-from-disk-in-async-task/451511)._
