So in this sense, are Kotlin coroutines also non-cooperative? They don't explicitly yield, but do have a mandatory API to use for "blocking" calls.
174 karma · joined April 1, 2019
So in this sense, are Kotlin coroutines also non-cooperative? They don't explicitly yield, but do have a mandatory API to use for "blocking" calls.
Also, there are cases where manual memory management, which usually boils down to reference counting, has great overheads where a GC-managed runtime has no overhead at all. They involve repeatedly building up and then discarding large data structures. GC algorithms simply don't see the dead objects, whereas refcount-based management must explicitly free the memory of each object.
Only very specialized workloads won't create much short-lived objects, and for those cases there are alternative non-generational GCs on the JVM (Z, Shenandoah).
Then there's the huge showstopper issue of the tragedy of the commons. People would lose the incentive to care for their batteries, they'd charge them to 100%, wouldn't care about their temperature, would do all kinds of abuse and then go for a replacement. This goes back to the initial argument of batteries not being as fungible as, say, gas.