Hacker News new | ask | show | jobs
by vips7L 1801 days ago
Unless I'm misunderstanding, virtual threads are preemptive: https://cr.openjdk.java.net/~rpressler/loom/loom/sol1_part1....
1 comments

What about pron's comments here then? https://news.ycombinator.com/item?id=27885569

> Second, Loom's virtual threads can also be forcibly preempted by the scheduler at any safepoint to implement time sharing

For me, preemption by the Java scheduler is not currently supported but may be added in the future, after all the goroutine were not preempted at the beginning in Go.

The whole quote

> Second, Loom's virtual threads can also be forcibly preempted by the scheduler at any safepoint to implement time sharing. Currently, this capability isn't exposed because we're yet to find a use-case for it

I believe it's a reference to [1] but i may be wrong.

[1] https://download.java.net/java/early_access/loom/docs/api/ja...

> The whole quote

Sorry I was skimming! Thanks!