# Atomicity Violation in Multithreaded Applications and Its Detection in Static Code Analysis Process
## 9 Conclusions  
In order to locate the conflicts causing the phenomenon of race condition, the developed source code model of multithreaded applications had to be extended with a new relationship that may occur between the two operations. The analysis of the literature showed that in the context of the phenomenon of race condition, the developed relations were not considered anywhere. Knowledge of this relationships may be used to improve programming language grammar or to create an extension for languages. Programmers aware of the existence of relationships have the possibility to create better architectures of applications and better unit tests. It is also possible that the developed relations may be used for research on various types of errors not only in multithreaded applications. Another interesting idea is use MASCM and developing relationships between memory allocation operations and memory deallocation operations to search for memory leaks in C applications.  
MASCM can be used also in mixed methods--e.g., for searching atomic regions. Additonally, code converted to instances of MASCM can be used with neural networks for intelligent methods of detecting race condition, atomicity violation, etc. To avoid false-positive errors there is need more researches on the atomicity violation and static analysis methods.  
The developed method based on a sufficient condition enabled us to locate two resource conflicts causing the phenomenon of race condition in the leading example, which improves code optimization in, for example, applications with parallel computing. Further research on the relations should also make it possible to predict the conflicts causing the phenomenon of order violation.  
During studies on atomicity violation, any false-positive errors do not occur, but there is no proof that developed rules of detecting do not allow that. It is possible to find part of code which in instance of MASCM can meet atomicity violation requirements, as it is in most other methods using static analysis of code.  
Due to the fact that 70% of all multithreaded errors [7] are errors that are a violation of atomicity, the development of a method that allows for their rapid detection only through static analysis of the source code may turn out to be a significant contribution to the field of computer science.  
Compilers that allow for detecting these errors during compilation process may permit us to avoid atomicity violation even before testing process. It means that programmers will be able to be more efficient, their programs will be less unreliable and the process of testing multithreaded applications will be less complicated because fewer cases will need to be checked.  
All authors contributed to the research work. [PERSON] proposed the main idea. [PERSON] and [PERSON] conceived the multithreaded application model and wrote the article together. [PERSON] implemented software tools and made experiments. [PERSON] reviewed the research work. All authors worked together and responded to the reviewers comments. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
The authors declare no conflict of interest.  
The following abbreviations are used in this manuscript:  
\begin{tabular}{l l} AII & Access Interleaving Invariants \\ AST & Abstract Syntax Trees \\ AV1 & Example application name \\ BWD & Backward \\ FWD & Forward \\ HAVE & Hybrid Atomicity Violation Explorer \\ JDK & Java Development Kit \\ MASCM & Multithreaded Application Source Code Model \\ PMD & Pthreads Mutex Default \\ PME & Pthreads Mutex Error Check \\ PMN & Pthreads Mutex Normal \\ PMR & Pthreads Mutex Recursive \\ SYM & Symmetric \\ \end{tabular}