Optimization of Numerical Simulation Algorithms in C++ with Multithreading Methods
摘要
Abstract
The main methods of numerical simulation (the finite difference method, the finite element method, the Monte Carlo method, and the Runge–Kutta method) are presented. The main parameters used to optimize numerical modeling algorithms in terms of code execution time and efficient use of processor resources are considered. The main disadvantages of multithreading related to data synchronization, deadlocks, and race conditions and methods for eliminating them based on the use of mutexes and atomic operations are analyzed, using the Monte Carlo method as an example.