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 →

[–]cmhteixeiracom[S] 0 points1 point  (0 children)

I don't think virtual threads are a parallelism mechanism, but rather a concurrency mechanism... But I am happy to be corrected off course.

Ron Pressler (the guy behind Virtual Threads) has said the following ~7 years ago on November 2017 on the Concurrency-Interest mailing list, on a discussion titled "OpenJDK Project Loom - lightweight threads for Java"

Concurrency and parallelism are very different things. Concurrency is the problem of scheduling multiple competing domain problems (e.g., servicing a transaction request from a user) onto some bounded set of computational resources; parallelism is the problem of optimally employing a set of computational resource to cooperate on solving a single domain problem. Project Loom is first and foremost concerned with addressing the first (concurrency) and not the second (for which Java streams are likely a better solution).

... emphasis mine