2 ms·
> if creating gazillion threads on modern hardware is super cheap why not? Virtual threads are a performance improvement over threads, no matter how cheap to c
by chipdart 2y ago
> if creating gazillion threads on modern hardware is super cheap why not?
Virtual threads are a performance improvement over threads, no matter how cheap to create threads are. Virtual threads run on threads. If threads become cheaper to create, so do virtual threads. They are not mutually exclusive.
Virtual threads are on top of that a developer experience improvement. Code is easier to write and maintain.
Virtual threads improve throughput because the moment a task is waiting for anything like IO, the thread is able to service any other task in the queue.
- riku_iki 2y ago> Virtual threads are on top of that a developer experience improvement. Code is easier to write and maintain. except now you need to prove somehow that all 100 libs in your project support virtual threads. > Virtual threads improve throughput because the moment a task is waiting for anything like IO, the thread is able to service any other task in the queue. from reading similar discussions, linux for example doesn't have true IO async API, you just push lock of Java thread to lock of thread in the kernel
- Fulgen 2y ago> linux for example doesn't have true IO async API io_uring has been around for a few years at this point, with vulnerabilities having been fixed to the point that it's fit for broadband usage.
- riku_iki 2y agoIn this discussion people claim io_uring is not real async IO, but just another kernel level threadpool: https://news.ycombinator.com/item?id=38919659 https://news.ycombinator.com/item?id=38919659