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
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.
atm, there are now instructions. these can be put into Operation objects and then given to a world to have it perform together all at once. many systems right now follow this approach. they create an operation, and then perform them after they finish writing instructions.
later on for global multithreading, these operations could be performed by 1 system listening for operation submissions.
Activity
[-]Using ECS through deferred events for multuthreaded cases[/-][+]Interaction with worlds from multiple threads[/+]popcron commentedon Aug 23, 2024
atm, there are now instructions. these can be put into
Operationobjects and then given to a world to have it perform together all at once. many systems right now follow this approach. they create an operation, and then perform them after they finish writing instructions.later on for global multithreading, these operations could be performed by 1 system listening for operation submissions.
popcron commentedon Mar 12, 2025
Reopened because I haven't actually tested this in practice