Presentation is loading. Please wait.

Presentation is loading. Please wait.

Clock Snooping and its Application in On-the-fly Data Race Detection Koen De Bosschere and Michiel Ronsse University of Ghent, Belgium Taipei, TaiwanDec.

Similar presentations


Presentation on theme: "Clock Snooping and its Application in On-the-fly Data Race Detection Koen De Bosschere and Michiel Ronsse University of Ghent, Belgium Taipei, TaiwanDec."— Presentation transcript:

1 Clock Snooping and its Application in On-the-fly Data Race Detection Koen De Bosschere and Michiel Ronsse University of Ghent, Belgium Taipei, TaiwanDec. 19, 1997

2 Contents n Clocks – Logical clocks – Examples – Disadvantages – Snooping clocks n An Application – On-the-fly data race detection – Snooped vs. Logical clocks n Conclusions

3 Tracking Causality n What? Capturing the causality relation between events on different processors. n Why? n Distributed algorithms design n Tracking of dependent events n Knowledge about the progress n Concurrency measure n... n How? Physical clocks vs. logical clocks.

4 n Each processor has its own logical clock. n The clock is advanced using a set of rules: – the monotonicity principle (clock consistency condition) is obeyed: – clocks from different processors are synchronized at synchronization operations Logical Clocks

5 An Example of an Execution

6 Example 1: Scalar Clocks – Timestamps are scalar values. – Better known as Lamport Clocks. – Clocks are incremented at each operation:

7 Example 2: Vector Clocks – A system with p processors has vector clocks of size p. – Vector clocks allow us to detect concurrent events.

8 Example 3: Matrix Clocks – A system with p processors has matrix clocks of size p  p. – Matrix clocks allow us to detect obsolete information: Process i knows that every other process k knows that the local time of l has progressed till t.

9 Disadvantages of Logical Clocks n Maintaining clocks introduces overhead (both in time and space). n Causality is a weak form of event ordering. n Events are ordered most of the time, even if they have no causal relationship. n Logical clocks cannot capture the ordering between these unrelated events.

10 Solution: Snooped Clocks n Snooped clocks are updated with clock infromation that is explicitely requested from the other processes.

11 An Application: On-the-fly Data Race Detection n Data race: two unsynchronized accesses to the same variable, and at least one of them modifies the variable. n Example: x=get_input() y=calculate1(x) z=get_input() wait_a_while() z=calculate2(y,z) task1task2

12 On-the-fly Data Race Detection n We collect all memory references per sequential block i between two successive synchronisation operations (a segment) in L(i) and S(i). n We check all concurrent segments i and j for data races. A data race is found if (or vice-versa)

13 Implementation n Concurrent segments are detected using vector clocks. n The amount of segments forces us to use on-the-fly data race detection: – as soon as a segment ends, its L(i) and S(i) are compared to all previous concurrent segments; – obsolete segments are removed as soon as possible.

14 Removing Obsolete Segments n A segment is obsolete if no new concurrent segments can appear. n Matrix clocks can be used to detect these segments:

15 Logical vs. Snooped Matrix Clocks Logical clocks:Snooped clocks:

16 Experimental Evaluation

17 Conclusions n Snooped clocks: – are not updated at synchronization operations; – are updated using explicit clock requests. n Timestamps based on snooped clocks instead of logical clocks are more precise. n Snooped clocks allow for a more efficient implementation of data race detection.


Download ppt "Clock Snooping and its Application in On-the-fly Data Race Detection Koen De Bosschere and Michiel Ronsse University of Ghent, Belgium Taipei, TaiwanDec."

Similar presentations


Ads by Google