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

It's been a while since I read up on this, but my understanding is that with OS threads, during a context switch it has to pop the entire process stack, which in Java is 1MB by default. This is expensive. Virtual threads "context switches" have much more lightweight stacks because the JVM knows exactly what kind of state needs to be associated with the virtual thread and thats where the difference lies.


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

Search: