×

Techniques and systems for data race detection

  • US 9,135,082 B1
  • Filed: 05/20/2011
  • Issued: 09/15/2015
  • Est. Priority Date: 05/20/2011
  • Status: Active Grant
First Claim
Patent Images

1. A method performed by data processing apparatus, comprising:

  • running two or more threads of a multithreaded program on a processor, the program being configured to;

    produce locksets, each of which indicate a set of one or more locks that a thread holds at a point in time; and

    cause a hardware implemented performance monitoring unit included in the processor to i) monitor memory accesses caused by the threads, ii) produce samples based on the memory accesses, each sample indicating an accessed memory location, wherein a sampling rate of the samples is controlled based on an overhead parameter, and iii) produce a separate processor interrupt for each sample;

    aligning, using each separate processor interrupt produced for each sample by the performance monitoring unit, the samples produced by the performance monitoring unit with locksets produced by the program; and

    determining an existence of a data race condition based on the samples and the locksets, the determining comprising;

    (i) identifying, from a first lockset of the locksets and a first sample of the samples produced for a first thread of the two or more threads, a protected access, by the first thread, to a memory location indicated by the first sample;

    (ii) identifying, from the first lockset and a second sample of the samples produced for a second thread of the two or more threads, an unprotected access, by the second thread, to the memory location indicated by the second sample; and

    (iii) determining the data race condition exists based on the identified protected access and the identified unprotected access; and

    selectively outputting an indication of the data race condition.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×