-
Notifications
You must be signed in to change notification settings - Fork 0
Description
all allocations are created on the thread that the World instance is created from. if there is system A and B, and both are on their own threads, the easiest way to have them update is inside a while(true) statement. but then any modifications to the world needs to be submitted as an event, that then gets processed on the causal thread. or both systems exist on the main thread, but within their update callback they will use a thread from ThreadPool (so its reused 1 thread per update, or 1 thread in total, per system).
the while(true) approach will probably require some kind of sync mechanism, so that it only performs its code when there are no outstanding commands to handle.
benchmarks for how systems can scale would be good for this, to compare reusing threads to a single thread per system.