Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
_old_dude_
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
29 ms
·
301.
▲
by
_old_dude_
10y ago
if the field is volatile, you have an happen before relationship between the volatile read of thing before the synchronized block and the volatile write inside the synchronized block, so you have no way to see the object partially initializ
302.
▲
by
_old_dude_
10y ago
var handles also uses the polymorphic signature trick to avoid boxing/unboxing of the arguments you get with the reflection (the same trick also allows to introduce 64 bits index array in the future BTW). and you can also do all memory
303.
▲
by
_old_dude_
10y ago
Scala's lazy val uses the double-checked locking pattern with the field declared volatile, (the private field thing in the example) that's why there is no issue
304.
▲
by
_old_dude_
10y ago
I agree with Chris, it would be a lot worse if generics were reified in Java because instead of having some spurious ClassCastExceptions, you will get memory corruptions instead.
305.
▲
by
_old_dude_
10y ago
Java 9 is not fully compatible with Java 8. So we will soon see first hand if doing more backward compat breakage, for good they told, will be accepted or not. I predict there will be an internet outrage when Java 9 will be out.
306.
▲
by
_old_dude_
10y ago
It's the opposite actually. Here the erasure is a good thing otherwise the bug described in the blog will have break the VM. The type system is broken because it supposes you have a type that exists and in the code you send null instea