You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tom Kemna edited this page May 23, 2020
·
2 revisions
Goal
The final goal of the job system is to create a safe asynchronized task executer that effectively utilizes all cores in the CPU.
Current state
Right now, however, it is simply a way to parallelize large functions by passing them to the subsystem. It is currently NOT protected against data racing, and should currently ONLY be used for when you're certain you won't be changing the same memory with multiple threads.
Usage
Lets assume we want to do two heavy load operations that take 8ms each. We could approach this issue by simply adding two jobs as such, after which we can return safely:
After the frame in which this function was called ends, we are guaranteed to have finished function LoadWorldModel and LoadGiantCastleModel. Passing in jobs that take longer than three seconds to complete will print a warning in the log.