A couple questions about multi-threading

So I’ve just completed my first tutorial on doing this, the 50000 prime numbers one. It was pretty awesome having the game not lag while this was computed. So I have a procedural mesh system working and currently it is all precalculated, but clearly this multi-threading would be hugely beneficial. I have a couple questions…

I keep running into people saying no UObjects, but then I see comments suggesting their might be support for this. Where does this stand right now? Can I modify members in a UObject on a thread other than the game thread?

If I can’t modify UObject members how do I effectively use the data contained in them? Should I move the data in them to non UCLASS objects? As an example, I have a large container that stores the floor level offset for each vert (int32), an FColor, and another int32. This container is a member of my world actor class where the procedural mesh generation occurs. I would like to be able to update the data in this container so that I can update the procedural mesh (and also keep track of changes).

Any advice would be appreciated, thanks!

Bump this. I would love to know about this things too!

Okay so after some more digging I’ve found this and this which seem to indicate that uobjects are fine, but if you are manipulating the data in them then you have to use FCriticalSection objects. So any information on this would be great, thanks!

When my function calls the game crashes. It brings me to the renderingThread.cpp StopRenderingThread(). It says

// This function is not thread-safe. Ensure it is only called by the main game thread.
check( IsInGameThread() );

I know that it occurs at the time I run the RuntimeMeshComponent function EndMeshSectionUpdate(). This is where the vertex positions have been updated and are submitted. The RMC is attached to an actor class that is currently spawned in the world.

Above I’m calling FSuspendRenderingThread()

removing that…

T GetValueOnGameThread() const
	{
		// compiled out in shipping for performance (we can change in development later), if this get triggered you need to call GetValueOnRenderThread() or GetValueOnAnyThread(), the last one is a bit slower
		checkCode(ensure(GetShadowIndex() == 0));	// ensure to not block content creators, #if to optimize in shipping
		return ShadowedValue[0];
	}