Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

SGX Threads

Sam5
New Contributor I
790 Views

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

0 Kudos
1 Solution
Surenthar_S_Intel
790 Views

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 

View solution in original post

0 Kudos
2 Replies
Surenthar_S_Intel
791 Views

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 

0 Kudos
Sam5
New Contributor I
790 Views

Thanks for your information. 

So, We can use multi threading in SGX application.

0 Kudos
Reply