I ran into this issue too!
You could try using a thread safe counter that the game thread checks for and then runs, but in general BP itself doesnt like multi threading so its only good for feedback not for core implementation.
I implemented a multi-threaded pathing system that sends FString data to a UMG visual log in Blueprints using a FString Array and just indicating to the game thread when it was safe to read from this FString data.
Multi-threaded pathing system with async generation / loading / UMG log
I used threadsafecounters to fire off BP events as needed, but these did not have any parameters.
If you need to send data to BP one of my two methods above should work.
One thing that wont work is trying to do BP stuff inside the thread, you can access data or trigger BP events on next game tick, but really dont think there’s a way to multi thread BP logic itself right now.
Relevant code:
FThreadSafeCounter ThreadSafeGenCounter_TotalPairs;
UFUNCTION(BlueprintPure,Category="Joy Pathing Map")
int32 PathMap_Gen_GetTotalPairs()
{
return ThreadSafeGenCounter_TotalPairs.GetValue();
}
//.cpp
ThreadSafeGenCounter_TotalPairs.Increment();
You could use threadsafe counter 0 or 1 to indicate when safe to read a BP exposed FString array in UMG.
But none of this has anything to do with actually running BP logic from inside a multi-threaded context cause I dont think that can be done yet ![]()
I think it will be one day though!
Video of Async Calc/Loading Exposed to BP/UMG