|
1 | 1 | //! Implementation of a data-race detector using Lamport Timestamps / Vector-clocks
|
2 | 2 | //! based on the Dynamic Race Detection for C++:
|
3 |
| -//! https://www.doc.ic.ac.uk/~afd/homepages/papers/pdfs/2017/POPL.pdf |
| 3 | +//! <https://www.doc.ic.ac.uk/~afd/homepages/papers/pdfs/2017/POPL.pdf> |
4 | 4 | //! which does not report false-positives when fences are used, and gives better
|
5 | 5 | //! accuracy in presence of read-modify-write operations.
|
6 | 6 | //!
|
7 | 7 | //! The implementation contains modifications to correctly model the changes to the memory model in C++20
|
8 |
| -//! regarding the weakening of release sequences: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0982r1.html. |
| 8 | +//! regarding the weakening of release sequences: <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0982r1.html>. |
9 | 9 | //! Relaxed stores now unconditionally block all currently active release sequences and so per-thread tracking of release
|
10 | 10 | //! sequences is not needed.
|
11 | 11 | //!
|
|
15 | 15 | //! This does not explore weak memory orders and so can still miss data-races
|
16 | 16 | //! but should not report false-positives
|
17 | 17 | //!
|
18 |
| -//! Data-race definition from(https://en.cppreference.com/w/cpp/language/memory_model#Threads_and_data_races): |
| 18 | +//! Data-race definition from(<https://en.cppreference.com/w/cpp/language/memory_model#Threads_and_data_races>): |
19 | 19 | //! a data race occurs between two memory accesses if they are on different threads, at least one operation
|
20 | 20 | //! is non-atomic, at least one operation is a write and neither access happens-before the other. Read the link
|
21 | 21 | //! for full definition.
|
|
24 | 24 | //! because it only re-uses vector indexes once all currently-active (not-terminated) threads have an internal
|
25 | 25 | //! vector clock that happens-after the join operation of the candidate thread. Threads that have not been joined
|
26 | 26 | //! on are not considered. Since the thread's vector clock will only increase and a data-race implies that
|
27 |
| -//! there is some index x where clock[x] > thread_clock, when this is true clock[candidate-idx] > thread_clock |
| 27 | +//! there is some index x where clock\[x\] > thread_clock, when this is true clock\[candidate-idx\] > thread_clock |
28 | 28 | //! can never hold and hence a data-race can never be reported in that vector index again.
|
29 | 29 | //! This means that the thread-index can be safely re-used, starting on the next timestamp for the newly created
|
30 | 30 | //! thread.
|
|
0 commit comments