Sun Studio 12: Thread Analyzer User's Guide

2.2.2 Create a Data-Race Detection Experiment

Use the collect command with the -r onflag to run the program and create a data-race-detection experiment during the execution of the process. For OpenMP programs, make sure that the number of threads used is larger than one. The following is an example command that creates a data-race experiment:

To increase the likelihood of detecting data-races, it is recommended that you create several data-race-detection experiments using collect with the -r race flag. Use a different number of threads and different input data in the different experiments.