简体   繁体   English

Dalvik 是否创建堆栈来管理线程

[英]Does Dalvik create stacks to manage threads

Unlike JVMs, which are simple stack-based machines, the Dalvik VM uses a register-based — which requires fewer instructions, avoids unnecessary memory access — resulting in better performance code.与 JVM 不同,JVM 是简单的基于堆栈的机器,Dalvik VM 使用基于寄存器的——需要更少的指令,避免不必要的内存访问——从而产生更好的性能代码。

But how does Dalvik manage thread stacks?但是 Dalvik 是如何管理线程堆栈的呢? Does it create a stack for a thread?它是否为线程创建堆栈?

Yes.是的。 The "registers" are just locations on the call stack. “寄存器”只是调用堆栈上的位置。 When you call into a method, it allocates however much space is needed on the stack to hold the "registers" for the method being called.当您调用一个方法时,它会分配堆栈上需要多少空间来保存被调用方法的“寄存器”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM