0

As we know that android implements on java 6, now moved to java 8. My question is regarding the double check locking ,many blogs suggested that double check locking is unbreakable after java 5 , due to happens before guarantee of "volatile".

Is it unbreakable for android also????

AV94
  • 1,824
  • 3
  • 23
  • 36
vishwjeet
  • 3
  • 3

1 Answers1

0

This has more to do with the JVM than with the language, more specifically with its memory model.

The double check locking flaw was 'fixed' by JSR 133.

It seems that Dalvik is complient since Android 4.0. I don't know about ART, but I hope it was designed with the new memory model in mind, as some popular Android library (e.g. EventBus) use double check locking.

Community
  • 1
  • 1
bwt
  • 17,292
  • 1
  • 42
  • 60