• To understand multi-process browsers, you need to understand what a process is and what a thread is.

So before we get to those two concepts, what is parallel processing

For example, when you received a major development requirements, you can put this task is divided into three sub tasks, let the other two people in your group together with you to complete this requirement, this is called parallel processing, multiple threads can be parallel processing, and single thread no, this is also very good understanding, assumes that the group is a person, you how you take the tasks out? , so single thread will not work.

  • So what is a thread and what is a process?

A thread cannot exist alone. It is started and managed by a process. What is a process?

A process is a running instance of a program, the detailed explanation is to start a program, the operating system will create a piece of memory for the program, used to store code, running data and a main thread to execute tasks, we call such a running environment process



  • Thread is attached to process, and multi-threaded parallel processing in process can improve computing efficiency
Four characteristics of the process/thread relationship:
1. If any thread in a process fails, the entire process crashes
2. Data in the process is shared between threads
3. After a process is shut down, the operating system reclaims the memory occupied by the process

When a process exits, the operating system reclaims all the resources applied for by the process. Even if any of these threads leak memory due to improper operation, the memory will be properly reclaimed when the process exits.

4. The contents of processes are isolated from each other

Process isolation is A technique to protect each process from interfering with each other in the operating system. Each process can access only the data it owns, preventing process A from writing data to process B. Because data between processes is strictly isolated, a crash or hang of one process does not affect other processes. If there is a need for data communication between processes, then a mechanism for interprocess communication (IPC) is needed.

Modern browser multi-process architecture:As can be seen from the figure, the latest Chrome browser includes: 1 browser main thread, 1 GPU process, 1 Network process, multiple rendering processes and multiple plug-in processes

Let’s analyze the functions of each process one by one:

  • Browser process: mainly responsible for interface display, user interaction, sub-process management, while providing storage and other functions
  • Render process: The core task is to turn HTML, CSS, and javascript into web pages that users can interact with. Both the typography engine Blink and javascript engine V8 run in this process. By default, Chrome creates a rendering process for each Tab Tab. Renderers run in sandbox mode
  • Actually, Chrome didn’t have a GPU process when it was first released. The original intention of using GPU was to achieve 3D CSS effect, but later the UI interface of web page and Chrome were drawn on GPU, which made GPU become a common requirement of browser. Finally, Chrome has introduced GPU processes on top of its multi-process architecture.
  • Web process: Responsible for loading web resources on a page. It used to run as a module in the browser process until recently, when it became a separate process
  • Plug-in process: is mainly responsible for the running of plug-ins. Plug-ins are prone to crash. Therefore, the plug-in process must be isolated to ensure that the crash of the plug-in process does not affect the browser and the page

All the above contents are inspired by the working principle and practice of teacher Li Bing’s browser. The original intention of the blog is also to record their own learning. If you don’t understand it, you can go to the corresponding data to learn