3 ms·
As you point out, the JVM is getting preemption by means of Loom. .NET already has coroutines (async/await) so it should already do what you stated.
by apta 6y ago
As you point out, the JVM is getting preemption by means of Loom. .NET already has coroutines (async/await) so it should already do what you stated.
- smabie 6y agoI'm not super familiar with .NET, but if it supports preemption, they why this? https://getakka.net/articles/concepts/actor-systems.html#blocking-needs-careful-management https://getakka.net/articles/concepts/actor-systems.html#blo... Coroutines in general are a form of cooperative multi-tasking (they must explicitly yield), but I might missing something about .NET's implementation.
- apta 6y agoIt is specific to blocking APIs, as per the page: > Examples are legacy RDBMS drivers or messaging APIs, and the underlying reason is typically that (network) I/O occurs under the covers The issue with async/await is that APIs need to be extended with their async counterparts. If they don't, then you have to be sure not to invoke blocking calls. Java won't have this issue as the runtime will take care of preemption.