Skip to content

midified atomic::ordering about FIRST_PANIC#427

Open
wang384670111 wants to merge 1 commit intoapache:masterfrom
wang384670111:fixed_ordering
Open

midified atomic::ordering about FIRST_PANIC#427
wang384670111 wants to merge 1 commit intoapache:masterfrom
wang384670111:fixed_ordering

Conversation

@wang384670111
Copy link

@wang384670111 wang384670111 commented Mar 31, 2023

https://github.com/apache/incubator-teaclave-sgx-sdk/blob/780dc8999477244d8ff1e6f418321adbec51ee58/sgx_tstd/src/panicking.rs#L288
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