Specifying a group of particular threads in ENamedThreads

Hello Friends,

I’m currently trying to convert our client network system’s multithreading parts which are previously implemented before I learned about TGraphTask. The reason why I decided to handle packets as async tasks instead of creating a new thread for every packet is that each of them shall just be analyzed and parsed for every frame. Process is very short and packets are being received frequently.

Naturally incoming packets effect uobjects, but uobjects should be modified in game thread. So I implemented it as using mutex. The problem is, if I choose DesiredThread as AnyThread, system may choose game thread as handler thread. Sometimes locking game thread from both sides causes crash.

There are few options in ENamedThreads. How can I prevent it to be using game thread?

Thanks for your help in advance.

Definitely should never block in a task graph task. That prevents the task graph from functioning properly. Best is to queue the data to be processed by the game thread later.

How did I miss those updates about multithreading support for 4.8 :slight_smile: I’m looking forward to hear your elaborated explanation about that radical change, otherwise, I’m quite sure there are a lot of difficulties and exceptions for some particular cases. A good tutorial would be very useful for community :slight_smile:

You might try just allowing editing of UObjects in other threads, now that we are on 4.8 which has a lot of support for multi threading of UObjects!

That’s why we have to be so careful to make sure all of our class constructors are thread safe, UObject Multi-threading is here!

(going to go update my wiki on this matter)

Rama

Keep in mind the MT of the UObject creates is limited to specific tasks and still requires work to be done on the game thread. What you ask for is a ton more work and will be the source of non-trivial bugs to track down by everyone involved