Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

midified atomic::ordering about FIRST_PANIC #427

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wang384670111
Copy link

@wang384670111 wang384670111 commented Mar 31, 2023

if FIRST_PANIC.swap(false, Ordering::SeqCst) {

I think the use of ordering here is irregular, FIRST_PANIC is used here for Signals in a multi-threaded environment, not to synchronize access to other shared variables. Although Ordering::SeqCst ensures the correctness of the program, it affects the performance of the program. Therefore, just Ordering::Relaxed needs to be used here to ensure the correctness of the program.

@volcano0dr
Copy link
Contributor

@wang384670111 Thanks for reporting this issue.

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.

3 participants