Gibadullin R.F., Viktorov I.V. —
Ambiguous Results when Using Parallel Class Methods within the .NET Framework
// Software systems and computational methods.
– 2023. – № 2.
– P. 1 - 14.
DOI: 10.7256/2454-0714.2023.2.39801 EDN: IDMOCV URL: https://en.nbpublish.com/library_read_article.php?id=39801
Parallel programming is a way of writing programs that can run in parallel on multiple processors or cores. This allows programs to process large amounts of data or perform more complex calculations in a reasonable amount of time than would be possible on a single processor. The advantages of parallel programming: increased performance, load sharing, processing large amounts of data, improved responsiveness, increased reliability. In general, parallel programming has many advantages that can help improve the performance and reliability of software systems, especially with the increasing complexity of computational tasks and data volumes. However, parallel programming can also have its own complexities related to synchronization management, data races, and other aspects that require additional attention and experience on the part of the programmer. When testing parallel programs, it is possible to get ambiguous results. For example, this can happen when we optimize concatenation of float- or double-type data by means of For or ForEach methods of the Parallel class. Such behavior of a program makes you doubt about the thread safety of the written code. Such a conclusion can be incorrect and premature. The article reveals a possible reason for ambiguity of the results received by a parallel program and offers a concise solution of the question.
Type decimal, Real numbers, Thread safety, Variability of results, Rounding errors, Multithreading, Programming language CSharp, Parallel programming, NET platform, Class Parallel