A static datarace detection method (and apparatus) for multithreaded
applications includes inputting a set of input information including a
multithreaded context graph (MCG) representation of a multithreaded
application, processing the set of input information, and outputting a
statement conflict set (SCS). The SCS is a set of statement pairs that
may exhibit dataraces. The processing of the set of information includes
initializing a synchronization object set for each of a plurality of MCG
nodes, performing a nested traversal on the MCG to identify pairs of MCG
nodes which are not mutually synchronized, and examining each pair of MCG
nodes which are not mutually exclusive to determine if pairs of
statements in the nodes represent a datarace by considering objects that
can be accessed by the statements.