Lock me up, Scotty!
summary
Custom lock replaces the stock std::mutex inside Intel SGX enclaves by keeping the synchronization state kept in enclave and combining a short bounded spin phase with a fallback futex via an OCall so the kernel never needs enclave-resident pointers. OCall overhead is about 10,000 cycles versus a syscall of a few hundred, so the design adaptive locking spins a fixed number of times then wakes the kernel. Benchmarks show 2–4× throughput and real workloads gain about 5–10% latency or throughput.
AI-written summary · about
