Skip to content

Issue 907: Make 5.1/atomic/test_atomic_fail_*.{c,F90} less racy#910

Open
tob2 wants to merge 1 commit into
OpenMP-Validation-and-Verification:masterfrom
tob2:issue_907
Open

Issue 907: Make 5.1/atomic/test_atomic_fail_*.{c,F90} less racy#910
tob2 wants to merge 1 commit into
OpenMP-Validation-and-Verification:masterfrom
tob2:issue_907

Conversation

@tob2

@tob2 tob2 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

fixes #907

The current code sets y = 1 and then atomically x = 10 in the first thread, expecting that once 'y' shows up as updated in the second thread, 'x' is also updated. - But this is racy.

With this commit, 'y' is set non atomically after the atomic write.

This applies to all 6 tests: tests/5.1/atomic/test_atomic_fail_{acquire,relexed,seq_cst}.{c,F90}.

The current code sets 'y = 1' and then atomically 'x = 10' in the first thread,
expecting that once 'y' shows up as updated in the second thread, 'x' is also
updated. - But this is racy.

With this commit, 'y' is set non atomically after the atomic write.

This applies to all 6 tests:
tests/5.1/atomic/test_atomic_fail_{acquire,relexed,seq_cst}.{c,F90}.
@tob2 tob2 changed the title Issue 907: Make 5.1/atomic/test_atomic_fail_seq_cst.c less racy Issue 907: Make 5.1/atomic/test_atomic_fail_*.{c,F90} less racy Jun 10, 2026
@tob2

tob2 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

@spophale @fel-cab @seyonglee – Please review.

(Cross-ref: last change to those files was done in Pull Req. #776)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests/5.1/atomic/test_atomic_fail_seq_cst.c has a race condition

1 participant