Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Sam5
New Contributor I
88 Views

SGX Threads

Jump to solution

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

Accepted Solutions
88 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

2 Replies
89 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

Sam5
New Contributor I
88 Views

Thanks for your information. 

So, We can use multi threading in SGX application.