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.
Is it possible to let two TChromium components use the same render process?
Is it possible to let two TChromium components use the same render process?
When One TChromium component is created, its render process will be created too. Sometimes one render process only serves for one TChromium component, sometimes serves for several TChromium components. It's random! Is it possible to control it ? For example, let two TChromium components use the same render process?
- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Is it possible to let two TChromium components use the same render process?
Hi,
The number of processes is managed internally by Chromium. There are several process models supported by Chromium but if I remember correctly, CEF only supports the default model.
Read this for more information about the process models :
https://www.chromium.org/developers/des ... ess-models
You can try these switches :
I haven't tested those switches and some people use this instead to enable the "process per site" model :
You can also set GlobalCEFApp.SitePerProcess to FALSE or use the --renderer-process-limit switch to limit to the number of renderer processes.
The full list of switches is here :
https://peter.sh/experiments/chromium-c ... -switches/
The number of processes is managed internally by Chromium. There are several process models supported by Chromium but if I remember correctly, CEF only supports the default model.
Read this for more information about the process models :
https://www.chromium.org/developers/des ... ess-models
You can try these switches :
- --process-per-site
- --process-per-tab
Code: Select all
GlobalCEFApp.AddCustomCommandLine('--process-per-site');
Code: Select all
GlobalCEFApp.AddCustomCommandLine('--process-per-site', 1);
The full list of switches is here :
https://peter.sh/experiments/chromium-c ... -switches/
Re: Is it possible to let two TChromium components use the same render process?
Thank you for your information! I'll think about it.
Re: Is it possible to let two TChromium components use the same render process?
salvadordf,
I made a test of JSExtension and found It doesn't support concurrency in one render process.
Browser process must sends JSExtension request one by one. If send the next request before last request's callback comes, it will be discarded.
This is found not only in one TChromium instance, but also in several TChromium instances running in one render process. For example, there are two TChromium instances A and B running in one render process. Sending JSExtension request to B must wait for the finish of Sending JSExtension request to A. I think the reason is that one render process only has one thread to handle all V8 javascript.
If A and B are running in different render process. It support concurrency.
I made a test of JSExtension and found It doesn't support concurrency in one render process.
Browser process must sends JSExtension request one by one. If send the next request before last request's callback comes, it will be discarded.
This is found not only in one TChromium instance, but also in several TChromium instances running in one render process. For example, there are two TChromium instances A and B running in one render process. Sending JSExtension request to B must wait for the finish of Sending JSExtension request to A. I think the reason is that one render process only has one thread to handle all V8 javascript.
If A and B are running in different render process. It support concurrency.
- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Is it possible to let two TChromium components use the same render process?
Each render process handles IPC messages in its main thread and GlobalCEFApp.OnProcessMessageReceived is executed in the render process main thread.
If there's only one render process then all IPC messages will be handled sequentially by one thread.
Read this for more details about Chromium's multi-process architecture :
http://www.chromium.org/developers/desi ... chitecture

If there's only one render process then all IPC messages will be handled sequentially by one thread.
Read this for more details about Chromium's multi-process architecture :
http://www.chromium.org/developers/desi ... chitecture

- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Is it possible to let two TChromium components use the same render process?
A quote from the JavaScript integration document :
https://bitbucket.org/chromiumembedded/ ... ntegrationWith CEF3 Blink (WebKit) and JS execution run in a separate renderer process. The main thread in a renderer process is identified as TID_RENDERER and all V8 execution must take place on this thread.
Re: Is it possible to let two TChromium components use the same render process?
OK! Thank you for your information.