Hacker News new | ask | show | jobs
by mike_hearn 1512 days ago
No, it doesn't. The reason the tweaks are at the OS level is because, apparently, Loom-enabled JVMs already scale up to that level without needing any tuning. But if you try that in C++ you're going to die very quickly.
2 comments

With C++ co-routines and a runtime like HPX, not really.

However there are other reasons why a C++ applications connected to the internet might indeed die faster than a Java one.

There have been userspace thread libraries for c++ for decades.
Sure, I wrote some myself. Q is what libraries you can use on top of the userspace thread package that are aware of the userspace threads rather than just using OS APIs and thus eg blocking the current OS thread.
There are .so interposition tricks that can be used for that.

I think Pth used to do that for example.

Could you elaborate?
For example: https://www.gnu.org/software/pth/pth-manual.html#system_call...

See the hard system call wrapping. This is just one option.