Download

Spawning/Destoying actors in a separate thread

I’m having a bit of trouble trying to find some up to date info on this. Since 4.8 I believe that UObjects are thread safe however I wasn’t sure if this also applies to actors? I’ve been doing some tests and spawning anything under 1000 actors on a separate thread seems to be ok (i have to disable ticking initially) but when doing much more than that I run into issues in the Editor. Seems to be in the Slate system and from what I can gather from the disassembly and looking at the memory it looks like memory is being cleared (however my asm debugging is very rusty so could be wrong).

Crashes in a stand alone game happen much less frequently and I have to spawn a much larger number of objects (> 20,000 usually, much more than i actually need). It’s also in a different place

So just looking for some advice. Info from around last year generally suggests that this sort of thing shouldn’t be done but I wasn’t sure if the 4.8 changes meant things were different now. I’ve also read that modifying actors outside the main thread is ok as it’s done regularly internally but haven’t been able to confirm this. Being able to spawn and destroy objects on a separate thread would REALLY make my project easier to work with and much more performant.

Edit: I’m using a similar method to Rama’s multithreading tutorial (A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums) in case that matters

Cheers,
Harley.

Curious to know the answer to this as well.