Testing Overlap at Known Synchronization Points

A parallel test can coordinate workers so important operations definitely overlap or occur in a particular sequence.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace two concurrent reads
  2. Keep tests bounded
  3. Let both operations reach the point required for the test
  4. Bound the test and clean up blocked participants

Trace two concurrent reads

Have both synthetic workers record a starting counter before letting either continue. Verify the expected result of both subsequent updates. See shared counter interleavings.

Keep tests bounded

If a worker fails before reaching the synchronization point, the test should have a diagnostic or bounded wait. Barrier behavior explains why.[1]

Let both operations reach the point required for the test

To reproduce a shared counter issue, each test worker reads the initial value and announces arrival at a barrier before storing. The barrier ensures both reads happened before either write proceeds. See a shared-counter interleaving.

Prepare same initial counter
A reads, then waits
B reads, then waits
Release both stores and inspect the result

Bound the test and clean up blocked participants

If one worker raises before reaching the barrier, the other should not wait forever. Use a timeout and report the failing phase. Verify all test workers finish.

References

  1. OpenMP Architecture Review Board, OpenMP API Specifications ↩