nuwa创建新进程源码分析

本文深入探讨了Nuwa在B2G操作系统中创建新进程的源码实现,涉及NuwaParent与NuwaChild的交互、fork过程、线程连接以及进程间通信(Ipc)机制。详细阐述了ContentProcess、ContentParent、ContentChild类的角色,以及Nuwa如何通过socketpair、messageloop和IPDL机制与B2G主线程和ioloop线程建立通道。同时解释了Nuwa与plugin-container的关系,Nuwa旨在提升系统速度并逐步替代plugin-container的角色。
摘要由CSDN通过智能技术生成

nuwa.cpp的作用,fork 对线程进行相关冻结设置复制等。线程级别的设置等。。。。

https://developer.mozilla.org/en-US/docs/Archive/B2G_OS/Security/B2G_IPC_internals

https://blog.csdn.net/hunter___/article/details/82912266

 

具体介绍如下内容:

通道的建立,通道的连接(b2g (parent )如何连接到通道,nuwa如何连接到通道),fork,进程的孵化,

b2g中主线程和ioloop线程之间进行了通道连接?

Nuwa中也一样,它的主线程与ioloop线程也进行连接?

 gecko/mozglue/build/Nuwa.h

。。。

extern "C" {

/**
 * The following 3 methods are used to synchronously spawn the Nuwa process.
 * The typical usage is:
 *
 *   The IPC thread                                The main thread
 *   1. Receives the request.
 *   2. NuwaSpawnPrepare().
 *   3. Request main thread to
 *      spawn. --------------------------------------+
 *   4. NuwaSpawnWait().                             V
 *                                                 5. NuwaSpawn() to clone all
 *                                                    the threads in the Nuwa
 *                                                    process (including main
 *                                                    & IPC threads).
 *                                                 6. NuwaSpawn() finishes and
 *            +-------------------------------------- signals NuwaSpawnWait().
 *            V
 *   7. NuwaSpawnWait() returns.
 */

/**
 * Prepare for spawning a new process. The calling thread (typically the IPC
 * thread) will block furth

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值