Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

NIO solved the problems with threads on the network in Java 1.5 (seminal cornerstone API that also had the concurrency package and rewrote the entire JVM memory model), but only in 1.7 the epoll solution became stable.

2004 -> 2011, 7 years!

Now they hopefully can work around the kernel for file descriptors (network and disk) saving 30% CPU globally on all Java servers.

Many nuclear power plants wasted on the kernel.



> Now they hopefully can work around the kernel for file descriptors (network and disk) saving 30% CPU globally on all Java servers.

Can you expand on this a little? Are you referring to the necessity to copy between kernel memory and user-space memory, or something else?


Maybe io_uring?


Yes


> Now they hopefully can work around the kernel for file descriptors (network and disk) saving 30% CPU globally on all Java servers.

How does this work around the kernel? This lets you write java code that uses async IO but make it look nice, like golang code. But this isn't DPDK.


The JDK would have access to network card and SSD directly.

Bypassing the kernel. Java is already sandboxed we don't need the kernel unless the net/ssd drivers crash completely.

It's a huge task/risk, but 30% is alot.


Awhile back I saw an implementation of a network stack in user space... unfortunately the author has a beef with Java and the Java version was written quite poorly; but despite that all versions were significantly faster than kernel (go figure).

Really what you are proposing is that server Operating Systems and hardware should have a "general NIC" for mundane shared tasks, and a dedicated NIC for handing over to a process and saying GLHF.


How does virtual threads get you DPDK? How do other apps get access to the network card and the SSD if you bypass the kernel?


Can’t it be done with MirageOS (OCaml lib that can create a bare-bones OS)


> Many nuclear power plants wasted on the kernel.

iTunes could have reached greater heights had they allowed nuclear plants.


>> iTunes could have reached greater heights had they allowed nuclear plants.

The old iTunes "Burn Disc" icon with its yellow and black colors and sharp angles always reminded me of the "Radiation Warning" symbol:

https://cdn.osxdaily.com/wp-content/uploads/2009/09/burn-iso...

https://en.wikipedia.org/wiki/File:Radiation_warning_symbol....

When you were burning your own custom mix CD, things got hot . . .




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: