3 ms·
Not with the Unsafe class. It was never intended to be used by anything except the built-in concurrency support classes, and it was just barely good enough. Ext
by hashmash 3y ago
Not with the Unsafe class. It was never intended to be used by anything except the built-in concurrency support classes, and it was just barely good enough. External libraries which made use of the Unsafe class did so by studying how it was used, and then assumed/concluded how it worked. Java 9 formalized everything with the VarHandle class, and it offers much more features than the Unsafe class.
- gpderetta 3y agoThanks for the clarification. Java was obviously a trailblazer on formally introducing advanced memory models on practical languages, but it did take a few tries to get it correct.