Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual threads? #155

Open
yawaramin opened this issue Mar 15, 2024 · 1 comment
Open

Virtual threads? #155

yawaramin opened this issue Mar 15, 2024 · 1 comment

Comments

@yawaramin
Copy link

This is just a question to satisfy my curiosity. Per the readme:

However, when it comes to memory there is a significant difference. The overhead of 500 threads, for example, is quite large compared to the one or few threads employed by NuProcess.

What does the overhead look like with Java's new virtual threads? It should be significantly reduced, iiuc?

@altrack
Copy link

altrack commented Jun 6, 2024

I'm super curious about this comparison, I found this blog post
https://github.com/marcobehler/marcobehler-guides/blob/main/java-project-loom.adoc#filesystem-calls

To cut a long story short, your file access call inside the virtual thread, will actually be delegated to a (…​.drum roll…​.) good-old operating system thread, to give you the illusion of non-blocking file access.

There is also io_uring feature in new Linux kernels
https://github.com/ikorennoy/jasyncfio

How these both compare to NuProcess?

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

No branches or pull requests

2 participants