Is Dalvik's memory model the same as Java's?

前端 未结 3 505
逝去的感伤
逝去的感伤 2020-11-28 23:58

Is Dalvik\'s memory model the same as Java\'s? I am particularly interested in whether reads and writes of reference and non-long/non-double primit

3条回答
  •  时光说笑
    2020-11-29 00:28

    As of 4.0 (Ice Cream Sandwich), Dalvik's behavior should match up with JSR-133 (the Java Memory Model).

    As of 3.0 (Honeycomb), most of the pieces were in place, but some minor things had been overlooked that would be difficult to encounter in practice (e.g. some edge cases in finalization).

    As of 2.3 (Gingerbread), Dalvik was generally correct on uniprocessors, but some key features required for proper behavior on SMP hardware (e.g. proper final field handling) was missing.

    Pre-Gingerbread, there were no memory barriers at all, and basic stuff like volatile long was broken.

提交回复
热议问题