Patent ID: 8423966

Claim:
A method for ensuring consistency of data and preventing data races, the method comprising: receiving and examining a computer program written in an object-oriented language; receiving sequences of accesses that form logical operations on a set of memory locations used by the computer program; receiving definitions of atomic sets of data from the memory locations, wherein said atomic sets are sets of data that indicate an existence of a consistency property without requiring the consistency property itself; inferring which code blocks of the computer program must be synchronized in order to prevent one or more data races in the computer program, wherein synchronization is inferred by determining by: analyzing for each unit of work, what atomic sets are read and written by the unit of work, wherein said unit of work comprises non-overlapping threads; ordering units of work by occurrence of the units of work first write events in an execution; associating a unique timestamp with each unit of work, respecting the order, by: assigning a timestamp to a write event of the unit of work to which the event belongs; assigning a timestamp to a read event of a most recent write to a memory location the event is reading; and marking a location as temporary until a last write is completed when a memory location gets written more than once by a unit of work; and providing a message indicating where synchronization is required.