Author:
Kharitonov D I,Odyakova D S
Abstract
Abstract
The article describes an approach to detecting race conditions with respect to a variable in a program, based on the automatic construction of a program model in terms of Petri nets. A simple sample program having race condition is given and the analysis of its behavior shows four different results of execution due to the race condition. Compositional model of the program in terms of Petri nets is presented that illustrates the process of automatic model generation. Notions of program control flow, global area and environment models are introduced. Reduction rules for the control flow model are defined and compositional representation of reduced program model is described. The formula for detection of race conditions is defined as: for a race conditions to occur, it is necessary that between the moment a variable is read by a thread and the moment this thread writes to a variable, an event of writing to the variable by another thread may occur. Compositional model of global variable capable of intercepting writing to variable events that lead to race condition is presented. By synchronizing the program control flow model with the global variable model it is possible to detect race conditions by building the reachability tree and checking for the presence of error event in it.
Reference9 articles.
1. Data race avoidance and replay scheme for developing and debugging parallel programs on distributed shared memory systems;Chiu;Parallel Comput.,2011
2. The Application of Coloured Petri Nets to Verification of Distributed Systems Specified by Message Sequence Charts;Chernenok;Proc. Spring/Summer Young Researchers’ Colloquium on Software Engineering,2015