incubator-teaclave-sgx-sdk icon indicating copy to clipboard operation
incubator-teaclave-sgx-sdk copied to clipboard

midified atomic::ordering about FIRST_PANIC

Open wang384670111 opened this issue 1 year ago • 1 comments

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.

wang384670111 avatar Mar 31 '23 15:03 wang384670111

@wang384670111 Thanks for reporting this issue.

volcano0dr avatar Apr 06 '23 11:04 volcano0dr