当前位置: 首页 > news >正文

哪家公司建设网站wordpress 采集伪原创

哪家公司建设网站,wordpress 采集伪原创,北京短视频代运营,南通网站备案简述 Android设备启动过程中#xff0c;先是Linux内核加载完#xff0c;接着Android中的第一个进程init启动#xff0c;它会启动一些需要开机启动的进程。 Zygote就是进程init启动起来的。Android中所有应用程序进程#xff0c;以及运行系统关键服务的System进程都是由Zygo…简述 Android设备启动过程中先是Linux内核加载完接着Android中的第一个进程init启动它会启动一些需要开机启动的进程。 Zygote就是进程init启动起来的。Android中所有应用程序进程以及运行系统关键服务的System进程都是由Zygote创建的。它通过复制自身的形式创建其它进程。Zygote在启动时会在内部创建一个虚拟机实例因此通过复制Zygote得到的其它应用程序进程和System进程都可以快速地在内部获得一个虚拟机地拷贝。Zygote启动完成后就立即将System进程启动以便各种关键服务被启动运行。 Zygote的启动 它以服务的形式被启动。 创建虚拟机 进程内创建一个虚拟机实例并注册一系列JNI方法。 frameworks/base/core/jni/AndroidRuntime.cpp /* start the virtual machine. */ startVM(mJavaVM, env); /* Register android functions. */ startReg(env); 接下来执行“com.android.internal.os.ZygoteInit”Java类的main方法继续执行启动。 ZygoteInit.main package com.android.internal.os; import android.net.LocalServerSocket; ... public class ZygoteInit {private static LocalServerSocket sServerSocket;public static void main(String argv[]) {...registerZygoteSocket();...if (argv[1].equals(true)) {startSystemServer();} else if (!argv[1].equals(false)) {throw new RuntimeException(argv[0] USAGE_STRING);}...if (ZYGOTE_FORK_MODE) {runForkMode();} else {runSelectLoopMode();}...closeServerSocket();...} } 创建Socket Zygote调用registerZygoteSocket();创建一个LocalServerSocket sServerSocket的Server端Socket等待以后运行在System进程中的服务ActivityManagerService创建的Client端Socket连接然后通过Socket进程间通信通知Zygote创建新的应用程序进程。 创建System进程 /*** Prepare the arguments and fork for the system server process.*/ private static boolean startSystemServer()throws MethodAndArgsCaller, RuntimeException {/* Hardcoded command line to start the system server */String args[] new String[] {--setuid1000,--setgid1000,--setgroups1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1018,3001,3002,3003,3006,--capabilities130104352,130104352,--rlimit8,,--runtime-init,--nice-namesystem_server,com.android.server.SystemServer,};...ZygoteConnection.Arguments parsedArgs null;int pid;try {parsedArgs new ZygoteConnection.Arguments(args);/* Request to fork the system server process */pid Zygote.forkSystemServer(parsedArgs.uid, parsedArgs.gid,parsedArgs.gids, debugFlags, rlimits,parsedArgs.permittedCapabilities,parsedArgs.effectiveCapabilities);} catch (IllegalArgumentException ex) {throw new RuntimeException(ex);}/* For child process */if (pid 0) {handleSystemServerProcess(parsedArgs);}return true; } 变量args保存启动System进程的参数。 Zygote.forkSystemServer()复制当前进程来创建子进程。 handleSystemServerProcess()继续处理System进程的启动。 轮询等待AMS请求创建App进程 private static void runSelectLoopMode() throws MethodAndArgsCaller {ArrayListFileDescriptor fds new ArrayList();ArrayListZygoteConnection peers new ArrayList();FileDescriptor[] fdArray new FileDescriptor[4];fds.add(sServerSocket.getFileDescriptor());peers.add(null);while (true) {...try {fdArray fds.toArray(fdArray);index selectReadable(fdArray);} catch (IOException ex) {throw new RuntimeException(Error in select(), ex);}if (index 0) {throw new RuntimeException(Error in select());} else if (index 0) {ZygoteConnection newPeer acceptCommandPeer();peers.add(newPeer);fds.add(newPeer.getFileDesciptor());} else {boolean done;done peers.get(index).runOnce();if (done) {peers.remove(index);fds.remove(index);}}} }/*** Waits for and accepts a single command connection. Throws* RuntimeException on failure.*/ private static ZygoteConnection acceptCommandPeer() {try {return new ZygoteConnection(sServerSocket.accept());} catch (IOException ex) {throw new RuntimeException(IOException during accept(), ex);} } 无限循环等待来自AMS创建的Socket连接。 sServerSocket在fds[0]位置。 每当accept()返回一个连接后将对应此连接的newPeer.getFileDesciptor()套接字描述添加到fds第0位置后下一次读取到数据时若在fds[0]以后的说明是前面的newPeer连接收到的AMS的创建新应用程序进程的请求。 runOnce()用来处理AMS创建新应用程序进程的请求。 System进程的启动 ZygoteInit.handleSystemServerProcess()执行System进程的启动操作。 ZygoteInit.handleSystemServerProcess() private static void handleSystemServerProcess(ZygoteConnection.Arguments parsedArgs)throws ZygoteInit.MethodAndArgsCaller {closeServerSocket();/** Pass the remaining arguments to SystemServer.* --nice-namesystem_server com.android.server.SystemServer*/RuntimeInit.zygoteInit(parsedArgs.remainingArgs);/* should never reach here */ } Zygote复制自身创建的子进程做为System进程这样它得到了Zygote的Server Socket但是用不到所以第一句closeServerSocket()关闭此套接字。 RuntimeInit.zygoteInit package com.android.internal.os;public class RuntimeInit {public static final void zygoteInit(String[] argv)throws ZygoteInit.MethodAndArgsCaller {...commonInit();zygoteInitNative();...// Remaining arguments are passed to the start classs static mainString startClass argv[curArg];String[] startArgs new String[argv.length - curArg];System.arraycopy(argv, curArg, startArgs, 0, startArgs.length);invokeStaticMain(startClass, startArgs);} } zygoteInitNative()在System进程中启动一个Binder线程池。 RuntimeInit.invokeStaticMain()静态方法调用com.android.server.SystemServer的main方法。 SystemServer.main 传递调用native方法init1() class SystemServer {/*** This method is called from Zygote to initialize the system. This will cause the native* services (SurfaceFlinger, AudioFlinger, etc..) to be started. After that it will call back* up into init2() to start the Android services.*/native public static void init1(String[] args); } init1()的工作 注册Service Manager的死亡通知调用binderDied()。System进程执行kill结束自己。 创建SurfaceFlinger、和SensorService两个服务。 返回SystemServer.init2()继续启动java语言开发的系统服务。 SystemServer.init2 public static final void init2() {Thread thr new ServerThread();thr.setName(android.server.ServerThread);thr.start(); } ServerThread继承自Thread。 ServerThread.run class ServerThread extends Thread {Overridepublic void run() {Looper.prepare();...// Critical services...try {...Slog.i(TAG, Activity Manager);context ActivityManagerService.main(factoryTest);...Slog.i(TAG, Package Manager);pm PackageManagerService.main(context,factoryTest ! SystemServer.FACTORY_TEST_OFF);...Slog.i(TAG, Content Manager);ContentService.main(context,factoryTest SystemServer.FACTORY_TEST_LOW_LEVEL);...Slog.i(TAG, Window Manager);wm WindowManagerService.main(context, power,factoryTest ! SystemServer.FACTORY_TEST_LOW_LEVEL);ServiceManager.addService(Context.WINDOW_SERVICE, wm);...((ActivityManagerService)ServiceManager.getService(activity)).setWindowManager(wm);...} catch (RuntimeException e) {Slog.e(System, Failure starting core service, e);}...Looper.loop();Slog.d(TAG, System ServerThread is exiting!);} } 启动各个Service然后注册到ServiceManager。 各个服务都使用Binder和其它服务使用者进程进行就行交互。 本文使用Atom编写 转载于:https://www.cnblogs.com/everhad/p/6290855.html
http://www.yutouwan.com/news/17567/

相关文章:

  • 常用来做网站的首页商贸有限公司起名字
  • 外贸建站系统源码微信企业网站html5模板
  • 网站的加盟代理邯郸网站制作基本流程
  • 网站分站是怎么做的中国app开发公司排名
  • 网站建设最重要的环节淘宝优惠券怎么做网站
  • 好看的知名企业网站为何公司做的网站很丑
  • 全国通网站建设WordPress在服务器什么位置
  • 陕西省建设厅网站怎么查焊工证wordpress邮件发送下载
  • 中国建设银行网站首页签约做关于灯饰的网站
  • 快速达建网站视频直播app开发
  • 自己做返利网站吗山西建设网站公司
  • 网站建设业务渠道WordPress调用发邮件
  • 中国建设银行信用卡网站首页江苏做网站
  • 网站排名优化软件电话wordpress 定期删除
  • 天津品牌网站设计活动策划方案书模板
  • 网站服务器在哪里wordpress自带轮播
  • 如何建设一个电影网站泉州网络公司排名
  • 如何做网站运营方城网站建设
  • 广州网站推广方案会ps的如何做网站
  • 上海装饰公司网站建设做网站要多少钱新乡
  • 服务器网站域名系统装置凡科和有赞哪个好用
  • 新竹自助网站网络营销的基本职能
  • 免费网站申请域名com网站开发实习过程
  • 怎样做展示型网站网站seo优化培训
  • 关于网站建设交易流程的描述一句话煎蛋网 wordpress
  • 网站管理手册充值网站源码php
  • 如何查做的网站排名python前端开发需要学哪些东西
  • 绵阳做公司网站想做苗木生意网站怎么怎么做
  • 做搜狗网站排名wordpress 爆路径
  • 营销型门户网站证明做二维码打款网站链接