时的Dalvik的内存模型一样 Java的?我在是否读取和参考写入和特别感兴趣的非 - 长
/非 - 双
原始变量是原子,但我也想知道有没有这两个平台的内存模型之间的差异。
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
primitive variables are atomic, but I would also like to know whether there are any differences between the two platforms' memory models.
由于4.0(冰淇淋三明治),Dalvik的行为应该匹配与JSR-133(Java内存模型)。
As of 4.0 (Ice Cream Sandwich), Dalvik's behavior should match up with JSR-133 (the Java Memory Model).
由于3.0(蜂巢),大部分作品已经到位,但一些细微的东西都被忽视了,这将是很难在实践中遇到的(在最终确定如一些边缘的情况下)。
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).
由于2.3(姜饼),Dalvik的是一般在单处理器上正确的,但需要在SMP硬件上正确的行为(例如适当的最后
字段处理)的一些关键功能缺失
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-姜饼,有完全没有记忆障碍,基本的东西,如挥发性长
被打破了。
Pre-Gingerbread, there were no memory barriers at all, and basic stuff like volatile long
was broken.