Re:Rust: Dropping heavy things in another thread can make yo...
by cesarb on Saturday May 30, 2020 @10:14PM
(#23366621)
Unfortunately, the alternative they recommend (Cleaner) only exists since Java 9, so it cannot be used by libraries that wish to remain compatible with Java 8 (which, in my experience, is most or all of them; so far, I haven't seen any Java library which has dropped compatibility with Java 8, and many only recently dropped compatibility with Java 6 or 7).
[ Parent
| on HN ]
Re:Rust: Dropping heavy things in another thread can make yo...
by altfredd on Sunday May 31, 2020 @01:12AM
(#23367368)
The actual alternative is PhantomReference, which exists since ancient times. Cleaner simply provides safe way to use PhantomReferences, which are rather tricky to use (by Java standards).