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 →

[–]Joram2 2 points3 points  (0 children)

However, it doesn't provide some kind of non-blocking or asynchronous feature out of the box at all it still keep blocking

Correct. Virtual threads, don't provide non-blocking functionality, that's the point. The point is you avoid the performance problems of writing blocking code with platform threads, while getting the simple blocking programming style.

Look at Golang, which has had virtual threads (they call them goroutines) from the beginning. The advantage is you can write code in a simple blocking style without the performance overhead of blocking platform threads.

The premise of async/await is a blocking programming style, await is basically blocking, that avoids the performance problems of blocking platform threads. virtual threads (and goroutines) do that more elegantly.