You must execute all broadcasting with Game Thread.
From your own thread you can create a simple dispatch and pass some data attached, send it to Game Thread and wait until it is “ready” to execute that event.
There’s plenty examples inside source code of Unreal Engine (and also within my SaveGame plugin lol)
That is in fact what I was doing: breadcasting events from the game thread while acquiring data in my own thread. Since it makes it framerate dependant, I wanted to broadcast from my own thread.
That’s ok if it can not be achieved. It is exactly what I expected. I was asking the question in case of there would be a magical way to do it
In fact, it seems It is pointless to have my own threads and that I should also get the data into the Tick function since I pass it to that function anyway.
Maybe if I could just change the Tick framerate of my actor it would do the job.
But it can be done without a tick, you have to take a look at engine source and see how threaded services’ “DoWork()” function is used.
I’ve been using “fire and forget” threads a lot… From these treads I delegate a simple static function that usually copy data (a struct as a copy) from my thread, sending it to Game “named” thread and immediately executing (making code thread safe)
I would post code, but I am on phone now, away from Pc.
Basically the network thread queue data into the queue each time they receive a message, and I dequeue data from that queue in the game thread every frame and broadcast events based on the dequeued data.