Package modelarium.multithreading
This package contains the infrastructure used by Modelarium to execute simulations in parallel. It manages thread coordination, task distribution, and synchronization on behalf of the simulation engine.
Users are not expected to interact directly with the components in this package or to manage threads themselves. Parallel execution is configured and applied automatically by the engine.
When designing models, it is generally preferable for agents to interact primarily with other agents that are updated within the same execution context. Interaction patterns that require frequent coordination or shared mutable state across parallel execution contexts may limit scalability and reduce performance.
Structuring models to favour local interactions, coarse-grained updates, and predictable access patterns can help the engine exploit parallelism more effectively and reduce contention.
Implementations in this package may evolve as parallel execution strategies and performance characteristics are refined.
-
ClassesClassDescriptionCoordinator thread responsible for managing synchronised access to shared simulation state between multiple worker threads in a parallel simulation.WorkerThread<T extends Results>Represents a single worker thread responsible for simulating one subset of agents across the configured number of ticks.