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

Code Available Here

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 :slight_smile: