DATA RACE DETECTION IN JAVA PROGRAMS USING SYNCHRONIZATION CONTRACTS
Data race occurs in a multithreaded program when several threads simultaneously access the same memory location and at least one of them has a write access. Data races are hardly reproducible and can damage global data structures; so, research in the area of automatic race detection methods has been carried out for more than 20 years. This article focuses on the issue of improving performance of dynamic race detection in Java programs without loss of precision. Synchronization contracts - partial specifications of multithreaded behavior - are introduced for solving this problem. Using contracts allows excluding parts of application’s code that are not interesting from the race detection perspective (e. g., external libraries). The paper also covers advantages and restrictions of the approach, the contracts specification language, and some implementation details.