Multithreading
Multithreading, the simultaneous iteration and modification of entities for extra speed.
Last updated
Was this helpful?
Multithreading, the simultaneous iteration and modification of entities for extra speed.
Last updated
Was this helpful?
Imagine that you have millions of entities and you want to move them all. It gets a bit difficult on a CPU core. But we have a solution for that too!
This is not a problem, because Arch comes with its own . This does not generate any garbage and is incredibly fast, even has dependencies and co. What more could you want? Let's be honest!
Not much is needed to set up multithreading. You set it up, you know it and that's it!
Wonderful, now we have set up the JobScheduler
, all we need to do is let it work to utilise the full capacity of our power!
And now we have EVEN more power to march our armies, marvellous, isn't it? Your computer will probably take off, but it's worth it.
If this is all too high level for you, there is also the option of tackling the problem further down. Not below the belt, of course!
And you'll have even more power for everything you set out to do... honestly, what do you want with so much power anyway?
This runs a query that processes the entities simultaneously on several cores of your CPU. Arch does everything for you by itself, all you have to do is set it up and change the name of the here and there... cool right? Just be careful, you have to synchronise access to other objects yourself!
Of course, every form of is supported again. Even .
Each of these calls, whether world.ParallelQuery
or world.InlineParallelQuery
, will block the main thread until the has been processed. The processing itself still takes place in parallel, but the main thread waits before continuing.