That means that Java programmers have to be very careful when writing code, lest they block the entire underlying (OS) thread!
Again, Go already went through that experience. It was painful. Java should have learned and implemented it from the start
That means that Java programmers have to be very careful when writing code, lest they block the entire underlying (OS) thread!
Again, Go already went through that experience. It was painful. Java should have learned and implemented it from the start
From JEP 444:
The scheduler does not currently implement time sharing for virtual threads. Time sharing is the forceful preemption of a thread that has consumed an allotted quantity of CPU time. While time sharing can be effective at reducing the latency of some tasks when there are a relatively small number of platform threads and CPU utilization is at 100%, it is not clear that time sharing would be as effective with a million virtual threads.
Also, in this scenario, i think the current scheduler (ForkJoin Pool) will use managed blocker to compensate those pinned carrier threads.
Still, an annoying gotcha if it hits you unexpectedly.