发明名称 Techniques and systems for data race detection
摘要 A race detection mechanism can include running 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. The mechanism can cause a performance monitoring unit included in the processor to monitor memory accesses caused by the threads and to produce samples based on the memory accesses, the samples being indicative of an accessed memory location. The mechanism can detect an existence of a data race condition based on the samples and the locksets. Detecting can include identifying a protected access to a memory location by a first thread of the threads and identifying an unprotected access to the memory location by a second thread of the threads. The process selectively outputs an indication of the data race condition.
申请公布号 US9135082(B1) 申请公布日期 2015.09.15
申请号 US201113112945 申请日期 2011.05.20
申请人 Google Inc. 发明人 Sheng Tianwei;Vachharajani Neil A.;Eranian Stephane;Hundt Robert
分类号 G06F9/44;G06F9/52;G06F11/36;G06F9/45 主分类号 G06F9/44
代理机构 Fish & Richardson P.C. 代理人 Fish & Richardson P.C.
主权项 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; andcause 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.
地址 Mountain View CA US