These browsers that have a separate process for each tab
-
I understand that modern browsers like to spawn multiple processes behind the scene, usually on a per-tab basis perhaps. Anyone know how this works, as what you seem to end up with is several processes all accessing the same window? Windows is funny about multiple threads accessing the same window, never mind processes. Perhaps the rendering is done in the main process and all the comms/javascript/layout calculation etc. in the child ones. I don't know, but I'd like to. Anyone shed some light?
Regards, Rob Philpott.
GitHub - chromium/chromium: Open-source project behind Google Chrome[^]
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
GitHub - chromium/chromium: Open-source project behind Google Chrome[^]
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
Thanks for the link, but I'm not sufficiently interested to go through that!
Regards, Rob Philpott.
-
They're not accessing the same window, each tab will be its own GUI window that the process for that tab will interact with, with the title-bar, tab selectors etc belonging to the parent app, but the area inside the tab will belong to the child process. Think of browser tabs like a Multi Document Interface where each document is always maximised to the size of the parent browser process.
Well this goes against my understanding. You have a main browser window which as you say has title bars and all that stuff, a child control/window (tab selector), and each tab will be its own window as well (probably chrome then another child for its client area). How on earth do you get another process to provide the rendering/message pump etc. to that?
Regards, Rob Philpott.
-
Thanks for the link, but I'm not sufficiently interested to go through that!
Regards, Rob Philpott.
It was a kind of joke, but I would risk here an answer now, even it is clearly a programming answer... In Windows, SetParent[^] can set the parent window even if it is from a different process... So technically it is an easy problem - all you need is to pass a HWND to the new (child) process and you are done... It is clear that in the case of Chrome the main process is different - in behaviour - from the others (even it is the same exe)... Hit Shift+Esc in Chrome and you will get a list o all the processes it is running... You can see that the one labeled 'Browser' can not be closed...This is the manager process... Now that you know all this, go and write a CP article about!!!
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
I understand that modern browsers like to spawn multiple processes behind the scene, usually on a per-tab basis perhaps. Anyone know how this works, as what you seem to end up with is several processes all accessing the same window? Windows is funny about multiple threads accessing the same window, never mind processes. Perhaps the rendering is done in the main process and all the comms/javascript/layout calculation etc. in the child ones. I don't know, but I'd like to. Anyone shed some light?
Regards, Rob Philpott.
What freaks me out more is when you look at the command line for each tab in Chrome:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=renderer --enable-features="*AutofillCreditCardSigninPromo
-
What freaks me out more is when you look at the command line for each tab in Chrome:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=renderer --enable-features="*AutofillCreditCardSigninPromo
HOLY CRAP!
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
What freaks me out more is when you look at the command line for each tab in Chrome:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=renderer --enable-features="*AutofillCreditCardSigninPromo
-
I understand that modern browsers like to spawn multiple processes behind the scene, usually on a per-tab basis perhaps. Anyone know how this works, as what you seem to end up with is several processes all accessing the same window? Windows is funny about multiple threads accessing the same window, never mind processes. Perhaps the rendering is done in the main process and all the comms/javascript/layout calculation etc. in the child ones. I don't know, but I'd like to. Anyone shed some light?
Regards, Rob Philpott.
Whatever else, have you ever had a look how many Chrome processes are sometimes running, even with only 1 or 2 tabs open? :omg: I currently have 13 processes for 3 tabs.
Follow my adventures with .NET Core at my new blog, Erisia Information Services.
-
I understand that modern browsers like to spawn multiple processes behind the scene, usually on a per-tab basis perhaps. Anyone know how this works, as what you seem to end up with is several processes all accessing the same window? Windows is funny about multiple threads accessing the same window, never mind processes. Perhaps the rendering is done in the main process and all the comms/javascript/layout calculation etc. in the child ones. I don't know, but I'd like to. Anyone shed some light?
Regards, Rob Philpott.
-
It was a kind of joke, but I would risk here an answer now, even it is clearly a programming answer... In Windows, SetParent[^] can set the parent window even if it is from a different process... So technically it is an easy problem - all you need is to pass a HWND to the new (child) process and you are done... It is clear that in the case of Chrome the main process is different - in behaviour - from the others (even it is the same exe)... Hit Shift+Esc in Chrome and you will get a list o all the processes it is running... You can see that the one labeled 'Browser' can not be closed...This is the manager process... Now that you know all this, go and write a CP article about!!!
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
Kornfeld Eliyahu Peter wrote:
SetParent[^] can set the parent window even if it is from a different process...
Right, it's time for a career change! That seems to go completely against the whole point of a protected operating system. If I was drunk in the pub, a £50 bet would be looming. I will investigate this further. I think I found my answer here though: Chromium Blog: Multi-process Architecture[^] The browser process creates many renderer processes, each responsible for rendering web pages. The renderer processes contain all the complex logic for handling HTML, JavaScript, CSS, images, and so on. We achieve this using the open source WebKit rendering engine, which is also used by Apple's Safari web browser. Each renderer process is run in a sandbox, which means it has almost no direct access to your disk, network, or display. All interactions with web apps, including user input events and screen painting, must go through the browser process.
Regards, Rob Philpott.
-
Whatever else, have you ever had a look how many Chrome processes are sometimes running, even with only 1 or 2 tabs open? :omg: I currently have 13 processes for 3 tabs.
Follow my adventures with .NET Core at my new blog, Erisia Information Services.
Brady Kelly wrote:
I currently have 13 processes for 3 tabs.
3 tabs = 3 processes +1 for main windows +9 for extensions (each extension runs in a separated process)
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
A window is not always "one process". Hosting EXE Applications in a WinForm project[^]
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
Well, this is all news to me, this SetParent() spanning processes. I downloaded that project, and the browser opened in a separate window, not as a child of the winform. I am going to remain a skeptic until I see this properly.
Regards, Rob Philpott.
-
Well, this is all news to me, this SetParent() spanning processes. I downloaded that project, and the browser opened in a separate window, not as a child of the winform. I am going to remain a skeptic until I see this properly.
Regards, Rob Philpott.
Replace the exename from "iexplore" to the full path of calc.exe; once you have the handle you can set a new parent to the window. The new parent-window of the mainform does not have to be part of the application, it just needs to be an existing window handle.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
Replace the exename from "iexplore" to the full path of calc.exe; once you have the handle you can set a new parent to the window. The new parent-window of the mainform does not have to be part of the application, it just needs to be an existing window handle.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
Genius Eddy! I am now going to work out how to utilize this madness! [edit: you're a y, not an ie, humble apologies]
Regards, Rob Philpott.
-
Genius Eddy! I am now going to work out how to utilize this madness! [edit: you're a y, not an ie, humble apologies]
Regards, Rob Philpott.
Rob Philpott wrote:
Genius Eddy!
Wasn't my idea to build Windows that way, but yes, great OS at some points. One way would be by wrapping functionality (and ui) inside a new standalone-application, and launch that instead of a thread. Makes debugging easier :) Or a way to hook some extra functionality inside an existing application.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
HOLY CRAP!
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013I don't know if it's holy, but for sure it's /redacted/.
DURA LEX, SED LEX GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
-
Rob Philpott wrote:
Genius Eddy!
Wasn't my idea to build Windows that way, but yes, great OS at some points. One way would be by wrapping functionality (and ui) inside a new standalone-application, and launch that instead of a thread. Makes debugging easier :) Or a way to hook some extra functionality inside an existing application.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
Well what I wanted to do, is to try and get two independent GUI threads working in the same window hierarchy, something I always thought was impossible. This would open the possibility of a process with lots of GUI threads (possible certainly, but not in the same window hierarchy as far as I knew). This does that, and I've done it in a single process by spawning a second thread and making it execute the message pump of a second form. Completely independent yes, but when you 'join' them together with SetParent(), although we now have two separate GUI threads, they block each other. ie. I created a replacement for calc.exe which was a form with a button with a Sleep(10000) behind it. Demo project works fine, but when you hit the button, the 'host' process is blocked as well - you can't drag it around or anything. This makes sense I guess as one will send a MoveWindow message or something like that to the other, which is blocked, won't respond so blocks the other. A small glimmer of opportunity, but its seems its not to be...
Regards, Rob Philpott.
-
AFAIK they all use different trheads - in fact if one tab crashes the whole browser is kaputt. Firefox qorks like that, IE is not a browser and Chrome kills my ram before starting up so I don't have too much experience on that one.
DURA LEX, SED LEX GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
ff only runs 1 process, even with many extensions & tabs and/or windows open. chrome is just getting stupid (and fugly); sure bare bones is [supposedly] fastest, but just a few add-ons just starting up and rendering is way slower. (Of course you idiots, inter-process communications are slow - who was the braniac that decided separate processes was a good idea???) Without add-ons only has minimal standard settings (yep, jus like msof they think all users are stupid). Even on my main box (16G DDR3 RAM) it's slower then ff so I rarely use it and have already banished from the task bar it to the depths of the Accessories menu (it so does not deserve it's own menu). The mess of directories it creates are just way stupid too, caches mixed in with data files - how to set inclusive backups for that without backing up the crap?? Getting time to ditch chrome for edge as secondary browser, the edge is actually improving while chrome is for all it's updates is still stuck where it was 5 years ago (updates almost always security fixes - that really inspires confidence: NOT).
Sin tack ear lol Pressing the "Any" key may be continuate
-
ff only runs 1 process, even with many extensions & tabs and/or windows open. chrome is just getting stupid (and fugly); sure bare bones is [supposedly] fastest, but just a few add-ons just starting up and rendering is way slower. (Of course you idiots, inter-process communications are slow - who was the braniac that decided separate processes was a good idea???) Without add-ons only has minimal standard settings (yep, jus like msof they think all users are stupid). Even on my main box (16G DDR3 RAM) it's slower then ff so I rarely use it and have already banished from the task bar it to the depths of the Accessories menu (it so does not deserve it's own menu). The mess of directories it creates are just way stupid too, caches mixed in with data files - how to set inclusive backups for that without backing up the crap?? Getting time to ditch chrome for edge as secondary browser, the edge is actually improving while chrome is for all it's updates is still stuck where it was 5 years ago (updates almost always security fixes - that really inspires confidence: NOT).
Sin tack ear lol Pressing the "Any" key may be continuate
Lopatir wrote:
Even on my main box (16G DDR3 RAM) it's slower then ff
Holy mother... I guess Chrome will never see the light of my CPU then. Even on my next PC (16 GB DDR4, Intel i5 6600 if all goes well).
DURA LEX, SED LEX GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
-
What freaks me out more is when you look at the command line for each tab in Chrome:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=renderer --enable-features="*AutofillCreditCardSigninPromo
Judas H. Priest. :omg:
Software Zen:
delete this;