SimulationSettingsEnableMultithreading Property |
Namespace: DigitalRune.Physics.Settings
When multithreading is enabled the simulation will distribute the workload across multiple processors (CPU cores) to improve the performance.
Multithreading adds an additional overhead, therefore it should only be enabled if the current system has more than one CPU core and if the other cores are not fully utilized by the application. Multithreading should be disabled if the system has only one CPU core or if all other CPU cores are busy. In some cases it might be necessary to run a benchmark of the application and compare the performance with and without multithreading to decide whether multithreading should be enabled or not.
The simulation internally uses the class Parallel for parallelization. Parallel is a static class that defines how many worker threads are created, how the workload is distributed among the worker threads and more. (See Parallel to find out more on how to configure parallelization.)