by zz865 · 5y ago · 0 comments
The other cost is context switching, which is much cheaper with virtual threads.
The context switching sucks so much that an alternate approach, swapping threads for throwing an exception on yield and re-running the method and ignoring side-effects until we get back to the resumption point, saves us a significant amount of time.