Section: Application Domains
Simulation of physical entities is used in many distinct areas, ranging from surgery training to games. The standard approach consists in discretization of time, followed by the integration using a stepwise method (e.g. Runge-Kutta algorithms). The use of threads to simulate separate and independent objects of the real world appears quite natural when the focus is put on object behaviours and interactions between them. However, using threads in this context is not so easy: for example, complex interactions between objects may demand complex thread synchronizations, and the number of components to simulate may exceed the number of available threads. Our approach based on FairThreads , or on the use of reactive instructions, can be helpful in several aspects:
Simulation of large numbers of components is possible using automata. Automata do not need thread stacks, and the consumption of memory can thus stay low.
Interactions are expressed by means of broadcast events, and can thus be dealt with in a highly modular way.
Instants provide a common discrete time that can be used by the simulation.
Interacting components can be naturally grouped into synchronized areas. This can be exploited in a multiprocessing context.