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.
Why all demos is single process?
Why all demos is single process?
I noticed that all your demos is in single process mode. It's happening when GlobalCEFApp.BrowserSubprocessPath value is empty.
Did you do this accidentally?
Did you do this accidentally?
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Why all demos is single process?
I checked several demos and I see several processes when I open different websites, specially in the tabbedbrowser and toolboxbrowser demos.
Many javascript demos open a file and you'll only see a couple of processes.
The default value of the GlobalCEFApp.SingleProcess property was not modified in the latest update. It's still False.
Many javascript demos open a file and you'll only see a couple of processes.
The default value of the GlobalCEFApp.SingleProcess property was not modified in the latest update. It's still False.
Re: Why all demos is single process?
Look at this function:
As you can see MultiExeProcessing is used when FBrowserSubprocessPath is not empty. But by default it is empty.
Code: Select all
function TCefApplication.StartMainProcess : boolean;
begin
if not(FSingleProcess) and (length(FBrowserSubprocessPath) > 0) then
Result := MultiExeProcessing
else
Result := SingleExeProcessing;
end;
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Why all demos is single process?
I should have used less confusing names for some internal functions.
When you set GlobalCEFApp.SingleProcess to True the application will only create one process with your application's executable.
However, if you set GlobalCEFApp.SingleProcess to False your application will create several processes.
To create all those processes CEF can use your application's executable or a different EXE for the subprocesses.
In the first case you will see your application's EXE several times in the task manager, for example :
But in the second case you will see your application's executable one time and one or more processes using a different EXE :
SingleExeProcessing is called when you want CEF to use your application's executable for all the subprocesses or in single process mode.
MultiExeProcessing is called when you want CEF to use a different EXE for the subprocesses. The SubProcess demo shows how to use a SimpleBrowser.exe as the main executable and a SubProcess.exe for all the subprocesses.
To use a different EXE for the subprocesses you have to set the GlobalCEFApp.BrowserSubprocessPath property with the name of the executable (e.g. subprocess.exe) and create a crash_reporter.cfg file as described here :
https://bitbucket.org/chromiumembedded/ ... porting.md
The Subprocess demo also includes a sample crash_reporter.cfg file.

When you set GlobalCEFApp.SingleProcess to True the application will only create one process with your application's executable.
However, if you set GlobalCEFApp.SingleProcess to False your application will create several processes.
To create all those processes CEF can use your application's executable or a different EXE for the subprocesses.
In the first case you will see your application's EXE several times in the task manager, for example :
Code: Select all
SimpleBrowser.exe
SimpleBrowser.exe
SimpleBrowser.exe
SimpleBrowser.exe
Code: Select all
SimpleBrowser.exe
SubProcess.exe
SubProcess.exe
SubProcess.exe
MultiExeProcessing is called when you want CEF to use a different EXE for the subprocesses. The SubProcess demo shows how to use a SimpleBrowser.exe as the main executable and a SubProcess.exe for all the subprocesses.
To use a different EXE for the subprocesses you have to set the GlobalCEFApp.BrowserSubprocessPath property with the name of the executable (e.g. subprocess.exe) and create a crash_reporter.cfg file as described here :
https://bitbucket.org/chromiumembedded/ ... porting.md
The Subprocess demo also includes a sample crash_reporter.cfg file.
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Why all demos is single process?
Hello,
Does this 'SubProcess.exe' file needs to exist or it's only a name to the subprocesses be created ? I just want the subprocesses don't have the name of my app.
Thanks !
Does this 'SubProcess.exe' file needs to exist or it's only a name to the subprocesses be created ? I just want the subprocesses don't have the name of my app.
Thanks !
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Why all demos is single process?
Hi,
SubProcess.exe must exist and it's a very small application that you can build using the SubProcess.dpr project in the SubProcess demo or creating a new project and using this code in the DPR file :
This SubProcess application doesn't have a form and it must have the same settings for GlobalCEFApp.cache, GlobalCEFApp.cookies, GlobalCEFApp.UserDataPath, GlobalCEFApp.FrameworkDirPath, GlobalCEFApp.ResourcesDirPath and GlobalCEFApp.LocalesDirPath as your main application.
Your main application must set GlobalCEFApp.BrowserSubprocessPath := 'SubProcess.exe'; before the GlobalCEFApp.StartMainProcess call in the DPR file.
For more details, read the code comments in the SubProcess demo.
SubProcess.exe must exist and it's a very small application that you can build using the SubProcess.dpr project in the SubProcess demo or creating a new project and using this code in the DPR file :
Code: Select all
program SubProcess;
uses
Windows, uCEFApplication;
{$SetPEFlags $20}
begin
GlobalCEFApp := TCefApplication.Create;
GlobalCEFApp.StartSubProcess;
GlobalCEFApp.Free;
end.
Your main application must set GlobalCEFApp.BrowserSubprocessPath := 'SubProcess.exe'; before the GlobalCEFApp.StartMainProcess call in the DPR file.
For more details, read the code comments in the SubProcess demo.
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Why all demos is single process?
Salvador,
Thanks again, i could make it work by following your instructions ! I will make some tests with singleprocess := false in order to available how stable the app will be now.
Thank you !
Thanks again, i could make it work by following your instructions ! I will make some tests with singleprocess := false in order to available how stable the app will be now.
Thank you !
-
- Posts: 513
- Joined: Thu Aug 10, 2017 12:40 pm
Re: Why all demos is single process?
Just to add an information, in my tests only with your code the app worked normally ; it was not necessary to set this parameters in the subprocess project : GlobalCEFApp.cache, GlobalCEFApp.cookies, GlobalCEFApp.UserDataPath, GlobalCEFApp.FrameworkDirPath, GlobalCEFApp.ResourcesDirPath and GlobalCEFApp.LocalesDirPath .salvadordf wrote: Tue Jan 16, 2018 1:01 pm Hi,
SubProcess.exe must exist and it's a very small application that you can build using the SubProcess.dpr project in the SubProcess demo or creating a new project and using this code in the DPR file :This SubProcess application doesn't have a form and it must have the same settings for GlobalCEFApp.cache, GlobalCEFApp.cookies, GlobalCEFApp.UserDataPath, GlobalCEFApp.FrameworkDirPath, GlobalCEFApp.ResourcesDirPath and GlobalCEFApp.LocalesDirPath as your main application.Code: Select all
program SubProcess; uses Windows, uCEFApplication; {$SetPEFlags $20} begin GlobalCEFApp := TCefApplication.Create; GlobalCEFApp.StartSubProcess; GlobalCEFApp.Free; end.
You main application must set GlobalCEFApp.BrowserSubprocessPath := 'SubProcess.exe'; before the GlobalCEFApp.StartMainProcess call in the DPR file.
For more details, read the code comments in the SubProcess demo.