首页 > 其他 > 详细

andriod zygote

时间:2018-04-28 12:53:11      阅读:194      评论:0      收藏:0      [点我收藏+]

/system/bin/app_process64   作为service 被启动,启动后comm:改成main ,cmdline 改成 zygote ,

main ->  runtime.start( com.android.internal.os.ZygoteInit)   调用在frameworks/base/core/jni/AndroidRuntime.cpp文件中的父类   AndriodRuntime::start ()  {启动虚拟机)  }  }  

c语言里通过JNI语法直接调用了java语言的 com.android.internal.os.ZygoteInit 类在 frameworks/base/core/java/com/android/internal/os/ZygoteInit.java

main-> startSystemServer()  -> Zygote.forkSystemServer { nativeForkSystemServer{}    }   

                                             ->  handleSystemServerProcess {} 

nativeForkSystemServer :   JAVA里面调用C  ,jni 实现在frameworks/base/core/jni/com_android_internal_os_Zygote.cpp下的com_android_internal_os_Zygote_nativeForkSystemServer() : fork  出来的进程进程,改了 comm 到system_server

-> ForkAndSpecializeCommon -> SetThreadName-> pthread_setname_np

 

andriod zygote

原文:https://www.cnblogs.com/stachal/p/8848009.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!