Skip to content

⚡ Bolt: Use delay instead of Thread.sleep for TEE emulation#568

Merged
tryigit merged 1 commit into
masterfrom
jules-delay-emulate-tee-2873208313759585067
Mar 28, 2026
Merged

⚡ Bolt: Use delay instead of Thread.sleep for TEE emulation#568
tryigit merged 1 commit into
masterfrom
jules-delay-emulate-tee-2873208313759585067

Conversation

@tryigit
Copy link
Copy Markdown
Owner

@tryigit tryigit commented Mar 28, 2026

💡 What:
Replaced blocking Thread.sleep calls with Kotlin's coroutine delay inside LatencySimulator's methods: emulateTeeOperation, emulateStrongBoxGenerateKey, and emulateStrongBoxCreateOperation. The functions were updated with the suspend keyword.

🎯 Why:
Calling Thread.sleep directly blocks the thread executing the operation. For TEE emulation layers executing on an IO/Main thread or during high concurrent operations, Thread.sleep limits thread availability, reducing the system's ability to efficiently multiplex. Using coroutine delay frees up the thread to perform other work during the delay, providing better resource utilization.

📊 Impact:
Non-blocking suspension significantly reduces thread contention and thread context-switching overhead in environments managing concurrent operations, matching standard Kotlin performance practices.

🔬 Measurement:
Given the specific TEE and StrongBox simulations and the lack of existing benchmarks, we verified correctness using the existing functional test suite (:service:testDebugUnitTest). The theoretical advantage is improved concurrent processing scalability due to released thread locks during sleep time.


PR created automatically by Jules for task 2873208313759585067 started by @tryigit

@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@appwrite
Copy link
Copy Markdown

appwrite Bot commented Mar 28, 2026

Yiğit

Project ID: 67b294d30004942511a5

Functions (1)
Function ID Status Logs
 Bootloader Hook 67b296050015d6532253 Queued Queued View Logs

Tip

Git integration provides automatic deployments with optional PR comments

@tryigit tryigit merged commit fa56b67 into master Mar 28, 2026
9 of 11 checks passed
@tryigit tryigit deleted the jules-delay-emulate-tee-2873208313759585067 branch March 28, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant