
Am Mi., 30. Dez. 2020 um 22:47 Uhr schrieb Viktor Dukhovni < ietf-dane@dukhovni.org>:
[...] It would amount to relying on GC to close the handle perhaps a bit earlier, and my take is that any such reliance is a bug.[...]
+1 As a general rule of thumb: Automatic memory management is good for, well, memory management, but nothing else. Quite the opposite: Most of the time it's horrible for other tasks. There are tons of points in the design space of automatic memory management with vastly different trade-offs regarding throughput, latency, concurrency etc., so tying other "heavy" resources like file descriptors to automatic memory management is a very, very bad idea. People had cunning ideas about how to (ab-)use finalizers etc. for decades, but basically all of them turned out to be bad. Hans-J. Boehm has written extensively about this, and his papers are still worth reading today.