Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Understanding Subprocess

Post Reply
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Understanding Subprocess

Post by salvadordf »

Hi,

This blog post talks about the reasons why Chromium/Chrome uses multiple processes :
https://blog.chromium.org/2008/09/multi ... cture.html

CEF creates many threads and a few subprocesses when you visit a website to carry out several tasks (rendering, GPU, etc.) in a safer way but using more memory.

In order to create another process CEF can do 2 things :
  • Run your application's EXE again.
  • Run a different EXE.
The default behavior is running you application's EXE again and that's why you see your app several times in the task manager when you open a website. Something like this :

Code: Select all

MyApp.exe
MyApp.exe
MyApp.exe
MyApp.exe
If your app has a complex initialization or uses the DPR intensively, adding the GlobalCEFApp initialization can be complicated. In those cases it's recommended to use a different EXE for the CEF subprocesses. The task manager would look like this :

Code: Select all

MyApp.exe
SubProcess.exe
SubProcess.exe
SubProcess.exe
In theory, CEF can be used in a DLL too and for those projects you would need to use a different EXE for the subprocesses.
Post Reply