Skip to content

run process spawning and IO operations on virtual threads if available#3683

Open
guptapratykshh wants to merge 1 commit intotypelevel:mainfrom
guptapratykshh:fix/issue-3539
Open

run process spawning and IO operations on virtual threads if available#3683
guptapratykshh wants to merge 1 commit intotypelevel:mainfrom
guptapratykshh:fix/issue-3539

Conversation

@guptapratykshh
Copy link
Contributor

Fixes #3182

i have optimized JVM process backend to offload blocking spawn and destroy calls to virtual threads on JDK 21+. This completes the task of making the process APIs non-blocking under-the-hood without introducing risky external dependencies.

Copy link
Member

@armanbilge armanbilge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR! Unfortunately, just throwing evalOnVirtualThreadIfAvailable at blocking is not a magic bullet.

For example, focusing on the case of process.destroy(): I believe that this is fundamentally blocking at the syscall level, and using a virtual thread cannot change that.

To proceed with this PR, could you create a small test (likely using thread dumps) that demonstrates that the virtual threads are not pinned to their blocked carrier thread, but asynchronously awaiting?

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.

Non-blocking backend for Process APIs

2 participants