Hi,
What are the thread synchronization mechanisms support in SGX? Why we need to specify the number of supported threads in the SGX project properties?
-Thanks
Link Copied
Hi Sam,
#1. sgx_threads, provide thread synchronization mechanisms like Mutex, Event and Condition variables inside an enclave.
#2. The enclave is signed at build time, which means that EPC memory pages (including thread contexts - stack, TLS, etc.) that will be allocated to the enclave have to be measured. This means, we need to specify the maximum number of threads that can run inside the enclave simultaneously. If several threads may run inside the enclave and access shared data, you'll have to synchronize them to avoid data race conditions.
-Surenthar
Hi Sam,
#1. sgx_threads, provide thread synchronization mechanisms like Mutex, Event and Condition variables inside an enclave.
#2. The enclave is signed at build time, which means that EPC memory pages (including thread contexts - stack, TLS, etc.) that will be allocated to the enclave have to be measured. This means, we need to specify the maximum number of threads that can run inside the enclave simultaneously. If several threads may run inside the enclave and access shared data, you'll have to synchronize them to avoid data race conditions.
-Surenthar
Thanks for your information.
So, We can use multi threading in SGX application.
For more complete information about compiler optimizations, see our Optimization Notice.