# Trying to write to a Render Target on a separate thread (Asynchronously)

**URL:** <https://forums.unrealengine.com/t/trying-to-write-to-a-render-target-on-a-separate-thread-asynchronously/606758>\
**Category:** Rendering\
**Tags:** Render-Targets, unreal-engine, UE5-0, Rendering, question\
**Created:** [July 17, 2022, 8:26am UTC](https://forums.unrealengine.com/t/trying-to-write-to-a-render-target-on-a-separate-thread-asynchronously/606758 "2022-07-17T08:26:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kriNon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kriNon](https://forums.unrealengine.com/u/kriNon)\
**Post date:** [July 17, 2022, 8:26am UTC](https://forums.unrealengine.com/t/trying-to-write-to-a-render-target-on-a-separate-thread-asynchronously/606758/1 "2022-07-17T08:26:15Z")

</div>

[Code Available Here](https://gist.github.com/kriNon/d6f212a194b0d805979532d8b2cf89e4)

I am trying to write to a render target asynchronously.  
Currently my code works, and it is running in a separate thread, however the asynchronous thread is blocking the main thread because of the .wait() method on line 48.

I want to try to get rid of the .wait() method, however I end up weird results if I do so.  
The code runs as expected for a very short time, and then it gets a memory access exception and crashes.

If anyone could point me in the right direction that’d be awesome 🙂
