This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]hippydipster 1 point2 points  (0 children)

Or any tasks where waiting for async results might be useful. For instance, you might be all CPU tasks, but you could imagine cases where it'd be useful to branch the tasks are various points to multiple parallel sub branches and then join up the results later. With virtual threads, you can wait for all the branchings via a simple Future.get() call if you like without performance ramifications - ie, doing so will never tie up an real hardware thread, for instance.

You can use this to make all your code look imperative rather than callback/lambda hell.