Thread.yield is currently implemented as "lazy submit" and is unfair when virtual threads are waiting in submission queues (started or unmarked by platform threads.
The issue tracks changing the implementation to check the local queue. If empty, use external submit, other use a regular submit. The effect will be improve fairness and release the carrier as users of Thread.yield will expect. The downside is that virtual threads may bounce between carriers.
The issue tracks changing the implementation to check the local queue. If empty, use external submit, other use a regular submit. The effect will be improve fairness and release the carrier as users of Thread.yield will expect. The downside is that virtual threads may bounce between carriers.
- is blocked by
-
JDK-8297495 j.u.concurrent updates for JDK 20
-
- Resolved
-