Open wang384670111 opened 1 year ago
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 Thanks for reporting this issue.
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.