In IE8 and Chrome, Processes Are the New Threads
SenFo writes "To many of the people who downloaded Google Chrome last week, it was a surprise to observe that each opened tab runs in a separate process rather than a separate thread. Scott Hanselman, Lead Program Manager at Microsoft, discusses some of the benefits of running in separate processes as opposed to separate threads. A quote: 'Ah! But they're slow! They're slow to start up, and they are slow to communicate between, right? Well, kind of, not really anymore.'"
I may be inadvertently responsible for Internet Explorer 8's use of separate processes for each tab. Months ago, when they invited me to install the beta of their latest web browser, I told them to do something that sounds very similar to "Go fork yourself!"
I think they took that as architectural advice.
I'm a big tall mofo.
Running each instance in a seperate process is NOT new technology, hell, any n00b who knows what JCreator is has seen that option before(see this comment I posted awhile back).
:)
Increases in computing power have made insignificant the perceived sluggishness of running multiple processes -- if Chrome won't run smoothly on that Pentium 2 of yours, then perhaps you should install command-line linux anyway!
Regarding Chrome, check out this response to my comment I linked to above, posted on June 30. At the time, I thought it was just an extension of a good idea but since his comment was posted earlier than Chrome was released I'm beginning to wonder if that fellow had any inside knowledge...
[/tinfoil hat]
...his argument that processes aren't really slower than threads anymore is because your processor is faster?
"The 70's called...." I can't bring myself to say the rest....
putting the 'B' in LGBTQ+
My head hurts, I'm confused.
Lacking <sarcasm> tags,
so are threads a bit like a conquistador shoe that is too small and stiff? Or a churro cake? Are they delicious? Is this what Bill Gates promised us in that Seinfeld ad? Because that would be cool. Mmm. threads.
..and it didn't take dual core or smp to make it fast either.
I've been preaching this for a long time. It's about time we seeing this. We'll see greater stability because of it.
Kevin
Tabs running in separate processes for process isolation for fault/crash tolerance is fine, but its only one benefit. However, 1) tabs running in separate threads shouldn't bring down the entire browser, if the application was properly designed in the first place; and 2) I'm sure we'll still find plenty of ways to crash the primary process and/or cause even separately running processes to do this.
I haven't tried IE8, but I uninstalled Chrome 5 minutes after installing it. It took Firefox about 20 seconds to load 8 sites, while Chrome took over a minute. If it's going to be that slow, nothing else matters.
AV slowing the start of each process is really going to cause a performance hit.
The real reason for processes instead of threads is cheap & dirty crash isolation. Who cares about RPC time, you don't do THAT much of it in a web browser.
But with more and more apps being composed IN the browser, you need isolation to get at least some crash isolation between "apps"
Test your net with Netalyzr
I actually am looking forward to Chrome on Linux. There was an article a few years ago about some changes in the Linux kernel regarding process creation. One of the highlights was how quickly a process could be created, almost as fast as a real thread. This was very old, but it also compared Windows/Solaris process creation and showed how much faster Linux was.
I imagine that most people who knew what Chrome is and actually installed it also know what processes are.
Dewey, what part of this looks like authorities should be involved?
The real issue here is that our OS's mechanisms for controlling resource sharing and protection among cooperating concurrent "lines" of execution (to avoid the words "process" or "thread") aren't as fine-grained as they could be. It's nearly an all-or-nothing choice between everything-shared ("threads") or very-little-shared ("processes"). Processes do get the advantage that the OS allows them to selectively share memory with each other, but threads don't get the natural counterpart, the ability to define their own thread-local memory domains, protected from other threads. A more powerful OS concurrency API would allow you to say exactly what things are shared and which are private to each unit of concurrent execution.
Are you adequate?
Tabbed browsing is now so normal that the problem of a crash in one tab bringing down all the others is big deal. On Vista, this problem happens a lot with IE7, and it's *the* single major annoyance for my geek GF on that platform.
Threads truly have their place, but this is a good use of separate processes per tab because it keeps one tab from crashing the others where threads can't achieve that.
It's the Windows job creation scheme mentality applied to OS threading: processes are heavyweight in Windows. "Process-spawning is expensive - not as expensive as in VMS, but (at about 0.1 seconds per spawn) up to an order of magnitude more so than on a modern Unix." More work = more hardware.
http://rocknerd.co.uk
There are some details to Chrome's sandboxing implementation that limit its security benefits:
- The process limit is 20. Anything requiring an additional process once this limit is reached, such as opening another tab, will be assigned randomly to any of the existing 20 processes.
- Frames are run within the same process as the parent window, regardless of domain. Hyperlinking from one frame to another does not change processes.
There are also some problems where valid cross-site JavaScript doesn't work. Of course it's still only a beta. Some specific details are documented by Google.
Developers: We can use your help.
I noticed immediately, as I'm sure many of you have, that both browsers isolate tabs in different processes
Huh?
You "noticed" this?
All on your own?
Really?
Haven't they been screaming this from the roof tops as why you should give it a try.
http://en.wikipedia.org/wiki/Jury_nullification
Share nothing processes which communicate via message passing is the future as far as I can tell.
Not only does that do away with most terrible multithreaded programming problems, but it also can let you write an application which does not need to execute all on the same processor or even the same machine, think concurrency, cloud computing, 1000 core processors, etc.
Look up the way Erlang programs work. Actor based programming is pretty sweet after you wrap your head around it.
As has been mentioned before, this *is* how browsers started. Back in the Stone Age, when the first browsers were created, they were specialized applications that could view one site at a time. In order for you to open multiple pages, you had to start multiple instances of the application, thus multiple processes.
Eventually, it was deemed more efficient to allow a single process to open multiple pages using multiple threads. So, again, this is nothing new, just a reversal to old ideas whose merits are debatable.
-dZ.
Carol vs. Ghost
I remember a story from a long time ago, during Longhorn's early development, where Microsoft did a study of the cpu cycles needed for various tasks between WinXP and Linux. I've never been able to track the study down again since, but I remember that creating a new process took about an order of magnitude more cycles on Windows than Linux. Linux processes are also lighterweight in general; Linux admins think nothing of having 100 processes running, while Windows admins panic when it hits 50.
(The basic reasoning goes that Linux has an awesome processes model because its thread model sucks, and Windows has an awesome thread model because its process model sucks. That's why Apache2 has pluggable modules to make it run with either forking or threading.)
A lot of development from the early Longhorn was scrapped, so how does Vista fare? Does its process model still suck?
Not a typewriter
Having gotten several gray hairs from debugging thread-lock issues, I can't help but wonder how these processes do IPC. Presumably complex objects (in the OOP sense) have to be serialized and written to files or piped through sockets. That's not necessarily a bad idea, but it means the data pathways are exposed to the OS, and it's a potential security issue, too.
2*3*3*3*3*11*251
IE7 on Vista? Is she a Microsoft geek, then?
It's hilarious anyone would think that. We're talking about a web browser, not a web server. Even on platforms where process creation is "slow", it's still going to be instantaneous from a single human's point of view. It's not like the user is opening 100 tabs per second.
As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
Every bandwagoner, technical lightweight is now stomping their feet that Firefox needs to get on this yesterday
Of course they want it yesterday... that is why they aren't as smart as you and I. They think you can go back in time.
Smart people like those reading this comment want it *today* or perhaps tomorrow morning. The honor roll students understand that today or even tomorrow might not be possible and instead are willing to wait a few days. The Mensa crowd and those working on Duke Nukem Forever or Perl6 are willing to wait until the code is the most architecturally perfect code ever written.
My point, for those reading still in the "I want it yesterday" crowd, is that you are asking for the impossible. Please be productive and demand the Firefox developers complete all code related to using a process per tab by the end of the day. Understand that until such time as those in the Duke Nukem Forever/Perl6/Mensa crowd invent the time machine, demands for "I want it yesterday" are simply unrealistic.
Your girlfriend is a geek who uses IE7 on Vista? Are you SURE?
And yes, a properly written multithreaded browser can prevent one tab from crashing another. The only way one tab could bring down the others would be if it spewed crap in the shared memory space. If you're letting web pages overwrite whatever memory they want then you've got big problems.
Wow. Does this mean what I think it means? Google/HURD!
Stallman, Schmidt and Ballmer throw off their remaining differences to develop a Free software Uber-browser-OS. Features include:
Seems like they have taken a leaf of Erlang wisdom here. If you were to write a browser in Erlang, using one (Erlang) process per tab is exactly the way you would have written it. I think it shows that designing software for robustness, something that previously mostly was done for high availability enterprise systems is now reaching the desktop.
Wouldn't surprise me if the next cool browser innovation will be hot code swapping so that you won't have to close all your 5324 tabs just to install the latest browser security fix. At which point they have reinvented Erlang. :)
Football Odds
There are at least three problems here.
One is efficiency. Nobody will argue that a properly implemented multi-threaded software project is going to be less efficient than a new process per job. If you're writing a server to handle 100,000 connections simultaneously you probably want to use threads.
One is necessity. If you're only going to have at most a couple hundred threads you don't need to think in terms of 100,000 processes - orders of magnitude change things.
The last is correctness. Most multi-threaded browsers aren't actually implemented correctly. So they grow in resource consumption over time and you have to do horrendous things like kill the main process and start over, which loses at least some state with current implementations.
So theory vs. reality vs. scale. There's no "one true" answer.
My God, it's Full of Source!
OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
There's another benefit to separating pages into processes. You can use standard OS tools (top, ps, Task Manager, System Monitor) to find processes that are eating up cycles and kill them. If I have 30 tabs open in Firefox, and one of them has some wonky JavaScript/Flash/Java that is munching the CPU, I have to kill the entire browser and start from scratch. With separate processes, I can shut down the specific offender and continue on (assuming it isn't the browser itself). I find this to be the most attractive feature of spreading pages into processes. It allows the OS to control *gasp* applications!
The wheel is turning, but the hamster is dead.
Everything is exposed to the OS, not just IPC.
Rethinking email
Before, when people were arguing between threads vs. processes, most of the arguments assumed ONLY ONE CPU. Forgive me if I'm wrong on this, but my understanding is that one of the biggest reasons modern day programs (programs, not OSs) under-utilize modern multi-core CPUs is that all threads of a process remain on the same CPU as their parent process.
So by designing an application to spawn new processes instead of threads, it un-handcuffs the multi-core CPU and allows it to distribute the work between all of its cores. Isn't this one of the reasons web servers and technologies (apache/tomcat/mod_proxy) spawn listening processes rather than just threads?
Yes, yes, more processes means more overhead, but given the cheapness of RAM, that has to be weighed against the benefits of being able to now access more CPU cores (in which case IE8 and Chrome seem to have chosen to go with the process model).
Faith is a willingness to accept something w/o complete proof and to act on it. Reason allows you to correct that faith.
UNIX didn't have threads for many years because its developers thought that processes were a better choice. Then, a whole bunch of people coming from other systems pushed for threads to be added to UNIX, and they did. Now, 30 years later, people are moving back to the processes-are-better view that UNIX originally was pushing.
Microsoft and Apple have moved to X11-like window systems, Microsoft and Google are moving from threads to processes, ... Maybe it's time to switch to V7 (or Plan 9)? :-)
The comic is a lie. The allocation of processes is quite complecated chromes-process-model. With a standard install you can quite easily create multiple tabs per process. Basically on a website site right click on a link to a page in the same website and select open in new tab. The new tab is then allocated to the same process. Once you have such a tab you can navigate to elsewhere on the web so you can easily end up with a situation where two different website in two different tabs share the same process.
There are four sorts of people in the world: fools, lunatics, idiots and morons. - Umberto Eco, Foucaut's pendulum.
Just what is exactly causing browsers to crash anyways?
Javascript? Wait, that's an interpreted language. If it's causing your browser to crash, then isn't there a problem with your interpreter?
HTML? Wait, if your browser is crashing on HTML, isn't the rendering engine buggy?
If anything is causing a browser to crash, I would suspect that it must be a plugin... And if that's the case, would it not make more sense to make the plugin run in a separate process instead?
Crashing is a sign that you ought fix your code, not stuff it in its own process. No web page should ever crash a browser in the same way no driver should ever crash an OS.
Clue: the problem isn't with primarily with the person who wrote the web page or the driver, although they should really go back and fix their shit too. The problem is with the browser or the OS.
If you need more than a thread to put up a web page and claim its all about the stability, accept the fact that you just plain suck and eff your crash tolerance.
Execute everything under a qsub command.
None of the processes were running on the same machines, don't know and don't care where they were. It's actually a more efficient way of running applications. All the firefox processes run on a few firefox servers, all of the OpenOffice processes run on an a few OpenOffce servers. Load balanced of course.
Running multiple instances of the same application on the same machine allows the most efficient use of RAM, CPU caches and of the CPU processing power. The libraries are only loaded once, it's only user data which takes up memory and that is a tiny fraction of the memory consumption. Plus, it screams. How often have you seen Open Office start in half a second?
Deleted
Everything is obvious in hindsight. We're really just bashing the fact that MS beat Mozilla to the punch on this one, where the opposite is almost always the case.
How are sites slashdotted when nobody reads TFAs?
Maybe my computer is fast (X2 4600+, 2GB Ram), but Chrome doesn't seem slow to me. I know Microsoft made a lot of under-the-hood improvements to Vista, is process creation overhead one of them? I hear a lot of people saying it's incredibly slow to open a new tab. Is everyone else running XP?
God save our Queen, and Heaven bless The Maple Leaf Forever!
It did sound a little Flamebaitish but seriously, Firefox is horrible on Linux. It is slow and little javascript / css menu dropdowns appear behind flash objects and I can't click them. I wind up firing up Windows in VirtualBox just to be able to click on a link. Maybe it is adobe's fault...I dunno.
In older days working with processes was more easy, later threads came, and then truning to processes agin. Every model works best under certain conditions, conditions change so do designs (even when it doesn't sound too much of an innovation). In the end the results count.
Design models are nice, but getting designs implemented right so they live up needed target result is something else. Google has done a nice job and so does Firefox. Microsoft should learn from this.
As long as Internet Explorer is not performing well there's so much room for others to gain marketshare. For the user to have something to choose from is a good thing.
Flamebait? I think not. FF is an awesome browser that I use as my default. But it does look to be lagging!
It's not altogether clear that they have ...
Lacking <sarcasm> tags,
Ok, for example how is this different from the child processes a web server spawns? I mean, it's not something new and unheard of.. Next thing they'll say you can run them as different users for increased security.. amazing..
seriously ever try and debug a threading issue? Keep it separate processes please. Also Erlang concurrency is a good approach I think.
There are edge cases where HTML will crash IE (or used to), and I remember some cases that would kill Gecko.
JavaScript is an extremely gnarly language to actually implement (most prototype-based languages are), and it's very difficult to stomp on all the bugs. There are also cases where an infinite loop in the JavaScript can wedge the browser, which this alleviates.
Plugins are a major issue, and that's almost certainly the next thing to be put in its own process.
Keep in mind that yeah, there are bugs in browsers, and they should be stomped on--but you can't get them all, and graceful recovery is still great to have.
"You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
I don't think that word means what you think it means. Google ADVERTISED that Chrome used a separate process for each tab, that was the main selling point.
Firefox has done an absolute shit job. Right now, Firefox is, full-stop, the worst browser out there.
For that matter, IE8 already does what Chrome does. The browsers that don't are Konqueror, Firefox, Safari, and Opera (plus the assorted little browsers not worthy of mention. Get a clue.
IE8 will be performing well, and Firefox is going to have their balls in a vise, crushed by Chrome and IE8.
"You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
Okay, I know this isn't a great precedent, but considering the ribbing Ruby and Rails have gotten for pushing the multiple process model (mostly because Ruby doesn't do OS-level threads, only "green" threads) it's intriguing that it's now becoming en vogue while Ruby is pushing to implement system-level threads in anger!
Ahh... that's the entire point. Multiprocess models are generally an acknowledgement of the fact that there are problems, and a way to mitigate their effect.
If you're running 3rd-party code inside your memory space in a thread (read: plugins) there is nothing you can do to prevent that code from trashing your process. The only solution is to isolate the resources they have access to by sticking them into a separate process.
In addition, it is *very* easy for bugs to make cause errors in shared data structures that end up corrupting the memory space for all threads. This is also true if you're using shared memory across processes, for that matter- if one process using the shared memory goes down, the entire shared memory must be considered suspect and trashed unless you've got some protected way of verifying/correcting it.
IPC over pipes or the like, with strict and correct validation of the messages passed there, is really the only way to correctly sandbox separate processes that want to work together yet be immune from non-local faults. Even then, if the processes have any sort of dependencies (children on a manager process, for instance) there may not be anything you can do to avoid a global failure if the dependency's target fails.
The ringing of the division bell has begun... -PF
> > forkin hell!
> And here I was hoping I'd see a Spoonerism somewhere.
There is no spoon
The whole deal with having a different process for each tab means that when a tab would normally lock up, it would take out the whole browser, whereas with seperate processes, the memory allocated to the processes are seperated which allows only one tab to crash and not the whole browser itself. Threads on the other hand are all apart of the same process which means if one tab contained in a thread crashes, the whole browser crashes. Granted I love threads, but in terms of that one pop-up crashing the 8 tabs I had open in firefox, good riddens.
BSD is for people who love Unix, Linux is for people who hate Microsoft.
Look at the history of Windows versions, so many of the changes from the early days through Vista are about defending the OS from third party software. (Both from crashing when running crapware, and from spewing all over the OS system files during installation of crapware.)
Third party software is often pure crap that can take down everything else.
The point is, you can't just say "write browsers that don't crash". Because you're going to use sites with crappy code and plugins or whatever that *are* going to crash no matter how good the browser is. (But ok sure, fix the browser bugs too please.)
HHAHAHHAHA!!
I was modded flamebait for making a legitimate observation about others who were essentially trolling with their unchecked cynicism.
I love this site...I really do. The few times I've been given negative mod points is whenever I call out others for being biased, cynical, etc.
Hilarious and pathetic at the same time.
Could someone give the gory details on how this all is accomplished? In particular, whether all processes access (and draw in) the same graphical context somehow, or they're just a bunch of z-ordered overlapping windows that move together when dragged?
I found Google's comic strip on process threading incredibly useful for explaining how all this stuff works.. I highly recommend reading it. check it out here.
*plays the Apogee theme song music*
> Plugins are a major issue, and that's almost certainly the next thing to be put in its own process.
Actually, if you read the comic, in Chrome (apparently) plugins already run in separate processes to the pages they live in. This is one of the most interesting aspects of it.
Process separation is a good idea, but the practice is somewhat different - my wife installed Chrome, and whenever it crashes, which is quite often, it BSOD's her computer, causing a reboot!
Oh god this is truely pathetic. Please save us all from obvious conceptual lessons about process isolation and complexity management.
Major browsers represent significant world class endeavours. If google is not prepared to be serious about it and invest the proper resources then I wish they would just close up their little project and get back to useful work like eliminating all of the link farm spam nonsense (largly subsidised by google adwords) that seem to dominate many of my google search results.
Heres an extremely unwise and unpopular idea... Hows about writing browsers that don't crash in the first place?
In todays "hostile" environment if your writing code that can crash you are most likely also writing code that can be explioted and ruin a whole lot of peoples days as their machines get 0wned and turned into bot-net-zombies.
I tried IEs last beta and it was completely unusable - right clicking a link and opening in new window would start a new process that was so new it didn't inherit cookie state or anything from the parent window. From what I hear chrome suffers similiar problems. Get it right or don't release it even as public beta... The bar should not be lowered to make novel newcommers feel wanted.
You can isolate threads from each other by not using shared memory as well. The only advantage to processes over threads is that the OS (MOST OSes) won't let one process write outside it's own memory space.
So processes make sense for certain things. BUT, in a web browser you're interpreting potentially malicious code from the open Internet. If your interpreter, be it the built in HTML parser, JS engine, or a plugin of some kind, has a penchant for overwriting memory it shouldn't, then the crash should be an excellent indication that you should be running that plugin, or that the built in interpreters have some serious security vulnerabilities and need some work.
I agree that isolating tabs in separate processes will potentially let your browser keep limping along. I disagree that this is a good thing.
I have a script that fakes a new home directory, and that keeps each new instance of Firefox from passing the URL over to the older process and exiting. This script is run when I launch a new browser, whether with a URL or not. It builds the fake home directory from a template (a tarball), makes the HOME environment variable point at it, and after a few other manipulations, fires up Firefox itself.
In theory it uses more memory. In reality I quit browsers I'm done with and they clean up well when the process exits. So the overall memory usage is actually less. And when one crashes or goes into a loop and needs to be killed (as happened last night on the Comcast web site), I only lose that process. I do not lose all the other browser instances I still may have sitting around and running (typically 5 to 8 started at any given time ... one of which is exclusively for Slashdot). It has worked rather well, so far.
now we need to go OSS in diesel cars
...Bell bottoms are back in style.
Shai Schticks:"You don't make peace with friends, you make peace with enemies"
That's the problem - with the OS you installed the app, you're responsible for it. If you run someone else's app on your machine, all bets are off.
With a web browser there's the expectation that a random web site should not be able to do bad things to my computer. If your browser crashes a lot it's annoying and I know it's unstable. If the crashes are covered up somewhat by using the OS to police separate processes then I'm more likely to blame the web site and not your browser.
Problem is, the fault IS in the browser. If I can write some HTML or javascript that crashes (or exploits) your rendering engine, that's a serious security flaw in the browser. The more obvious and irritating that situation is, the more likely it is to get fixed.
Just curious: how did this story get a Unix tag before it got a Windows tag? Both Chrome and IE 8 are Windows programs (oops, I almost wrote "apps").
I use FF3 on XP in a heavy way: 8 windows, 20 tab each one. I also use suspension so it accumulates a lot of trash in its cache because i rarely restart it. I usually see FF grow over one GB. This is not the problem I bought ram for that. The problem is the performances! I tried Chrome and I like it even if it takes more ram than FF. The real point is: give me a way to identify which tabs make my browser hang, and how much mem they use so that I can close them if I need. I don't care if a tab is implemented with a thread o process.
It is slow
Are you sure that's not Flash? Or nspluginwrapper?
and little javascript / css menu dropdowns appear behind flash objects
Known bug. I think Flash finally solves it, but only in recent versions of Flash and Firefox 3, and only on 32-bit.
Maybe it is adobe's fault...
<rant>Everything is Adobe's fault.</rant>
Don't thank God, thank a doctor!
I have several threads, of undetermined material, now hanging from the sleeping bag in which I sleep on the basement sofa.
/. about how "VISTA SUX".
Threads? Ya want some? I generally snip 'em with my nail-clippers, and subsequently use 'em as dental floss.
If the damn cats don't swallow them first.
The few processes I am able to understand are-
-Wake up in the morning...
-Take a dump,
-stagger off to the computer,
-and then rant on
-Before Mom yells "Why don't you get a fukin JOB!"
My whole LIFE is a buncha fukkin thread processes!
If only I coulda been a broad like Sylvia Plath...
.
- Aaron A. -
Bringing Pinoqachole to the natives since 1643.
I don't know how YOU browse porn, but I go to a gallery and ctrl-click every image that looks like it might whet my whistle, sometimes opening up 50 or more tabs, then pulling out my peter and inspecting each and every tab, saving and closing them one by one. How will chrome's process-per-tab model handle this I ask you!!!
Troll? Really? Because I said something against the beloved Firefox?
"You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
I hadn't read the comic. Very cool, though. Hopefully IE8 does the same thing (probably IE9, though).
"You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
You cannot so isolate threads without effectively making them separate processes. If the threads *can* write into other memory, then there is the danger that broken code *will* do so. What code you write doesn't matter in the least- get a dangling pointer and you'll be writing to something random, which may very well be some other thread's memory space. If the OS doesn't enforce the isolation, you effectively have no isolation.
No code is perfect. The process model is an acknowledgement of that fact. When it comes to plugins, the code is third-party- adobe, etc. Do you really want the stability of the browser as a whole to depend on third-party code?
You acknowledge the security vulnerability possibility, but you seem to be missing that the process model is an example of the sort of sandboxing that is precisely appropriate for limiting the impact of those vulnerabilities. Given sufficient OS-level control, in fact, you could run plugins in subprocesses specifically barred from touching any other portion of the system- that's precisely the sort of the risk-mitigation that we want browsers to be moving toward.
I certainly agree that the process model as currently implemented continues to have some efficiency issues, and the incompleteness of its implementation wrt chrome reusing process and the like impairs or removes some of its benefits. But I'm not sure how it can be held that the segregation and robustness benefits are actually downsides, as you seem to be saying- if Flash crashes or hangs due to a broken flash app, I'd really rather not lose the email I'm writing in another tab.
The ringing of the division bell has begun... -PF
THREAD terminate YOU !
I think this makes the browser's more robust. There's nothing more annoying than having 10 tabs open and IE crashing and taking them all down.
"I can count on one hand the number of times I've had a problem with Firefox that would have been solved by it being in its own process."
Really? Well I would need an abacus the size of france to count the number of times it would have solved a problem for me. Firefox + flash are a well known crash/lockup combination on linux and of course since the browser is threaded ALL instances lock up.
Shared memory is so simple a child could use it and pipes lend themselves quite nicely to multiplexing.
CPUs are not designed to provide component isolation within a process. You either share everything or nothing. That's a VERY BIG PROBLEM, that not only affects browsers, but also kernel design. The battle between micro-kernels and monolithic kernels exists simply because there is no in-process component isolation enforced at hardware level.
In the context of a previous Slashdot discussion on Microkernels, I emailed Andy Tanenbaum and asked him what he thinks of hardware component isolation inside processes. He welcomed the idea, but he said it is going to be a tough sell to CPU manufacturers.
Personally, I don't think that much change is required in CPUs. Actually, what is only needed is two more tables: a) a table like the page table, that defines component boundaries within a process, b) a component function entry table. Accessing something outside of the boundaries would cause a hardware exception. Accessing a function of another component should only be allowed if the target address is contained in the function entry table. Both tables could be implemented as assosiative caches, with very little CPU die dedicated to them.
Wow, I uninstalled Chrome after I found this out. Just loading chrome eats up almost 100MB ram. Ridiculous. I mean, I have 5gb of ram, but no way am I loading something on my system that eats that much ram up. Not to mention the processes involved. I think Google needs to revamp this and take the bloat out of it
This doesn't really contradict anything you said (since you were talking about the actual underlying implementation), but...
If you're using a decent language like Erlang using threaded I/O with 100,000 connection is(*) not a problem. That's because Erlang is free to do non-blocking I/O even if it looks like normal threaded I/O in your program.
(*) Should not be. I'll freely admit I don't know what Erlang actually does, but if it does anything other than non-blocking/async I/O behind the scenes I'd be very surprised.
I've searched before but haven't found a clear answer. What's a process and what's a thread in Win32, and what are the differences?
Actually, a lot of us are bashing both MS and Google by criticizing the merits and practicality of process-per-tab/page architecture. Pointing out that it is an old idea just adds to the argument that perhaps it was discarded or obsoleted originally for a reason.
But of course, what's old is new. Plus ca change, plus c'est la meme chose. (damn! can't use unicode in Slashdot??)
-dZ.
Carol vs. Ghost
Windows interprocess communication has become easier and easier over the decades. It is so robust that (8 years ago) you could use your clipboard and custom clipboard formats to store IPC data. The clipboard system is so advanced that any process that subscribes to the clipboard event model will be notified when new data arrives. Using named pipes is easy as well. One great feature about Windows is that you can construct your files to be based on sockets, named pipes, and file based data, using the same programmatic interface. It is actually very robust and IPC on Windows is very developer friendly. This is just in my own experience. I know that Windows sucks elsewhere, but I will defend it for IPC.
"If the threads *can* write into other memory, then there is the danger that broken code *will* do so."
And that is exactly my point. Any broken code allowing memory writes where it shouldn't is a serious security vulnerability. It is better that that broken code crash the whole browser, because then it will get fixed faster. If it just crashes a few badly written web sites it will be a low priority fix... until someone exploits it.
The problem with this is that there are actually two solutions.
You're arguing that security vulnerabilities should just (potentially, potentially not) cause crashes in the hope that this gets them fixed faster. However, you should be aware that not all such bugs actually cause immediate crashes- some just corrupt state. You're also arguing, effectively, for leaving the vulnerability there until it is fixed.
The other option is to sandbox things so that it doesn't matter if there's a vulnerability- if the process is correctly sandboxed, unless there's an OS bug that would allow privilege escalation, nothing can be exploited.
You're basically saying "let's try to make these problems more obvious so they get fixed faster". A properly written process model is saying "let's acknowledge that such bugs may always exist, and prevent them from harming anything at a higher level".
The ringing of the division bell has begun... -PF
Listening to the explanation of Chrome it sounds like it has a lot of good ideas on paper. When I look at it practically, as an Opera user, it does a lot of things differently in order to solve problems I never had in the first place, but overall it still hasn't implemented things I take for granted now.
A quote: 'Ah! But they're slow! They're slow to start up, and they are slow to communicate between, right? Well, kind of, not really anymore.'"
They've NEVER been slow under Linux. Or I think Solaris. Or several other UNIXes. A process is just a thread with it's own address space, so the time difference between them is approximately 0. The aversion to processes, and using threads constantly instead, is a Windows thing, because launching processes used to be like 10x slower (or worse) than threads (I don't know if it still is.)
If you have a bug that can write arbitrarily to the process's memory space then it doesn't matter whether that bug is in it's own process, or in a combined process with the rest of the browser. There's no reason why the main browser process should be running with any higher permissions than the tabs. I can see a possible exception for some kinds of plugins. Running a plugin or a flash interpreter in a nice low permissions process might be a good idea. I don't think running the whole tab that way is.
You're attributing something to this "properly written process model" that is unjustified. The tabs need just the same (or higher) privileges than the main browser process. Google themselves haven't said anything about sandboxing. They've only stated that their goal is to prevent one tab from crashing another.
Right, now simply create a process for every new page I visit, and hell, even two for my favourite pr0n sites which use flash, because you're too lazy to make your browser multithreaded and bug-free. Heck, there's enough memory for everyone on my PC.
I need my flash pr0n player in its own process. Everything else may crash but I can go on watching.
and plug-ins are created by an idiot
I think that you, sir, either haven't seen what populates the web recently. Or you've been dead.
More seriously :
I can count on one hand the number of times I've had a problem with Firefox that would have been solved by it being in its own process.
I can deduce that, apparently, you don't use Adobe's abominable Flash which is a frequent Firefox crasher (thankfully, I don't have to either), nor Adobe's awful Acrobat which can freeze Firefox for several minutes at startup and even more on close (luckily neither do I) nor have a browser which completely freeze for a couple of minutes once a huge download is finished, while an on-demand scanner analyses the file (sadly, sometimes I have to put up with the world-of-worm which is Windows and adding ClamWin seems to be a necessary evil).
Also, you seem to exclusively run a very small amount of very meticulously selected plug-ins, none of which were written "by an idiot".
Your life on the web is probably a very happy one, bar from the occasional blinking GIF that manage to slip through AdBlock+ (which I think count among the few selected plugins that have the privilege to be allowed to run on your browser).
The sad truth is that your situation, although typical for a /. geek, isn't even remotely representative of the random Joe-6-pack netizen "of teh interwebs".
They have to put up with a world of pain composed of constant crashes and slow downs (admittedly, half of which are caused by all the ad-/spy-/mal-wares running because of the random clicking on unknown mail attachment).
And they would definitely benefit from a multi-process browser. (Also, that browser could finally put at good use the quad-core expensive overkill that the random Joe-6-pack user got conned into buying by the store's vendor)
Also don't neglect a significant advantage of a multi-process system (which was humorously pointed in the launch ad) :
- The user will more easily know who's to blame for any instability issue. Because only *that* process will crash while everything else continue to work.
That may help put an end on all these "FireFox is a bloated crash-prone resource hog" trolls.
"Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
BS... Hubris has nothing to do with testing and bulletproofing code. Planning for epic fail with a kluge (and it IS a kluge no matter how you may attempt to spin it) instead of designing a piece of software correctly is just lazybonez.
...that you can't fix every bug.
I'm not disagreeing necessarily with the pragmatic implication, but you don't win points by committing fallacies. "We live in the real world, ergo nothing's perfect" is essentially the simpleton's strawman. The fact of the matter is that code can be crash tolerant, and yes graceful recovery is the next best thing. However the answer is not "If we put this crashy little thing over here in its own process and let it take a crap here so it doesn't wreck everything". Has this addressed the issue causing it to crash? Not at all. In fact the trade-off is clear. Much greater resource utilization.
Maybe you can't fix every bug. But you can fix most. See, built in crash tolerance: reduce the number of bugs causing crashes. Besides IE6 had a similar crash tolerance scheme. Multiple web pages? Multiple browser windows. For some reason, they decided tabbed browsing would be better for some reason. Oh well.