Greetings dear community!
I know that ue4 provides some multithreading functionality and I’ve read Rama’s tutorials about subject (THANK YOU, RAMA!). So my question is more theoretical, because I didn’t have an experience with multitasking before.
Lets assume that I have 100 people on one server. During game run I write (somehow) some data (somewhere). At some point (say once in a minute) I need to make some complicated-very-heavy stuff with this data. For that I’ll have one special thread. But how can I organize my data a way it will not lock the main thread?
More precise: In main thread I’m sending some data to special thread. Let’s assume that this data is just a number (for example, 10e6 or 30e7) of how much should I calculate FMath::sin(). This number should be written in special container (what container? I assume there should be some thread-safe container?). Once a minute special thread should take this numbers from special container and start calculations of FMath::sin(). But how can I safely manage this work, i.e. don’t write to special container while calculate numbers? Is there a better way?
One more question: Does ue4 containers thread-safe?