Patent ID: 7971248

Claim:
In a computing environment supporting multi thread operations, where different threads can perform read and write operations on shared data, the environment including safe threads that are properly configured to use variable locks on shared variables, a method of detecting and/or tolerating races occurring due to malicious threads not respecting the locks, the method comprising; (a) making at least one local copy of the shared data that is used exclusively by a safe thread when performing read and write operations during a critical section and wherein the safe thread refrains from writing to the shared data during the critical section and such that the shared data remains unchanged by the safe thread during the critical section, wherein the critical section defines a time frame in which a variable lock is placed on the shared data; (b) making at least one reference copy of the shared data that remains unchanged by the safe thread or a malicious thread during the critical section; (c) causing any read and write operations performed by the safe thread to be performed on the at least one local copy of the shared data during the critical section; (d) allowing any read and write operations performed by malicious threads to be performed on the shared data during the critical section; (e) comparing the shared data, the at least one local copy of the shared data, and the at least one reference copy of the shared data to determine that a race has been detected, a race existing when a final computation state of all threads after having executed does not correspond to a case when all the threads would have executed as safe threads with atomic and sequential memory consistency; and (f) at least one of indicating that a race has occurred or correcting the race.