Slashdot Mirror


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.'"

86 of 397 comments (clear)

  1. Have to watch what I say by bigtallmofo · · Score: 5, Funny

    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.
    1. Re:Have to watch what I say by The+Ancients · · Score: 2, Funny

      forkin hell!

    2. Re:Have to watch what I say by gEvil+(beta) · · Score: 3, Funny

      forkin hell!

      And here I was hoping I'd see a Spoonerism somewhere.

      --
      This guy's the limit!
    3. Re:Have to watch what I say by Wyzardking · · Score: 2, Funny

      Tomorrow's headline: Anonymous Coward deported to Sweden. Claims he's not from there.

    4. Re:Have to watch what I say by dwywit · · Score: 5, Funny

      What, something like hawking fell ?

      --
      They sentenced me to twenty years of boredom
    5. Re:Have to watch what I say by tacocat · · Score: 2, Funny

      I want a shirt that says, "Protect your resources: Fork Off and Die"

    6. Re:Have to watch what I say by CrazedSanity · · Score: 2, Funny

      It just goes to show, if ya can't fork it, spoon^H^H^H^H^Hthread it!

      --
      Sanity is like a condom: rather have it and not need it, than need it and not have it.
  2. Processes by Ethanol-fueled · · Score: 5, Interesting

    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]

    1. Re:Processes by ergo98 · · Score: 5, Insightful

      Running each instance in a seperate process is NOT new technology

      Well of course. It isn't even new in the browser world. In fact it's where we started.

      The earliest browsers required you to run a new instance for each concurrently opened site. This presented onerous resource demands, so they made it more efficient by having multiple window instances run under one process, and then with tabs that obviously carried over to tabs running under one shared process.

      This is so much ado about nothing. 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.

      Every bandwagoner, technical lightweight is now stomping their feet that Firefox needs to get on this yesterday, but really this is pretty low on the list of things that make a real improvement in people's lives. In fact I would go so far as to call it a gimmick. Presuming that the sandbox of a browser automatically stops sites from doing stupid stuff (unlike IE that will let a site kill just by going into a perpetual loop in JavaScript), and plug-ins are created by an idiot, this is completely unnecessary.

      Chrome's great JavaScript is a real story, one upped by Firefox's ThreadMonkey doing one better. Those are real improvements that really do matter.

    2. Re:Processes by TheRealMindChild · · Score: 2, Interesting

      Using processes over threads will also benefit when it comes to cluster computing. You can't really migrate a thread to another node, because then you have shared memory coherency issues. However, migrating a process is much easier.

      --

      "When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
    3. Re:Processes by 7+digits · · Score: 2, Insightful

      > 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 restart firefox roughly twice per hour when developing my javascript application. Having 10 concurrent tabs executing heavy javascript/ajax generally hangs the browser.

      Of course, extenions (in particular FireBug) are probably responsible of that, and it is painful but not a showstopper. A process per tab model would probably be better for my usage...

    4. Re:Processes by ThePhilips · · Score: 4, Insightful

      Running each instance in a separate process is NOT new technology [...]

      True, *nix does that for last 3 decades.

      The point here (and of RTFA) is that finally on Windows processes are becoming cheaper, making them usable for all the nasty stuff *nix was indulging itself for all the time.

      On NT 3.5, creation of new process was taking sometime as long as 300ms. Imaging Chrome on NT: if you open three tabs and start three new processes, on NT in the times, that alone would have taken about one second.

      Unix never had the problem. It's Windows specific. And they are improving.

      --
      All hope abandon ye who enter here.
    5. Re:Processes by ShadowRangerRIT · · Score: 2, Insightful

      Not to rain on your parade, but exactly how are you intending to use browsers in cluster computing? Are you expecting to have so many tabs that a full compute cluster is needed to run them? Your post seems to completely forget that we are talking about a web browser!

      --
      $_ = "wftedskaebjgdpjgidbsmnjgcdwatb"; tr/a-z/oh, turtleneck Phrase Jar!/; print
    6. Re:Processes by Firehed · · Score: 4, Funny

      javascript application

      Well there's your problem...

      --
      How are sites slashdotted when nobody reads TFAs?
    7. Re:Processes by FishWithAHammer · · Score: 4, Insightful

      It's primarily improvements in computer speed. Threads are very cheap in Windows (and this is why .NET in particular is so heavily dependent on spawning tons of threads for many types of tasks) and processes remain fairly expensive, but that expense is somewhat minimized by being about to throw ten kajillion bogomips at the problem.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    8. Re:Processes by piquadratCH · · Score: 4, Funny

      Not to rain on your parade, but exactly how are you intending to use browsers in cluster computing?

      Didn't you get the memo? The browser is the new operating system! So, naturally, it belongs on a cluster.

    9. Re:Processes by gnud · · Score: 3, Insightful

      This is so much ado about nothing. 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 own a fairly old computer, and every time I open or close a javascript-heavy page, or open a PDF file, all the rest of my tabs become unusable for some seconds. It's not the end of the world, but I can't think of anything that I'd rather firefox devs spend their time on.

    10. Re:Processes by firefly4f4 · · Score: 5, Interesting

      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.

      Possibly you can, but the biggest one I can count is having a flash plug-in (or similar) crash the entire browser when there's only a problem on one tab. That happens more frequently than I'd care for, so if there was a change that only brought down one tab, that would be great.

    11. Re:Processes by AaronLawrence · · Score: 2, Insightful

      Agreed - crashes in the browser itself are rare - Firefox seems very reliable in that way.
      However crashes in plugins can be common, and indeed trusting a big binary blob to invasively use your process safely just seems like a bad idea. So I would say that firefox should definitely go for that part and not worry about the process-per-tab part.
      Well like most good ideas it has been in Bugzilla for years!
      https://bugzilla.mozilla.org/show_bug.cgi?id=156493

      --
      For every expert, there is an equal and opposite expert. - Arthur C. Clarke
    12. Re:Processes by Tumbleweed · · Score: 2, Insightful

      This is so much ado about nothing. 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.

      Every bandwagoner, technical lightweight is now stomping their feet that Firefox needs to get on this yesterday, but really this is pretty low on the list of things that make a real improvement in people's lives.

      You've made here the classic mistake of thinking that everyone else uses a piece of technology in the same way that you do. This is not the case. With the advent of tabs, I typically have multiple dozens of them open at any given time. I also often leave programs running for days on end. I surf a LOT of very different sites, most of which I've never been to before, and which often have lots of javascript and/or Flash. This makes for a very different experience than you describe, as I've often had Firefox crash, sometimes without any warning at all, just *poof*, the window is gone without even a warning message. Fortunately, the crash recovery features of FF3 are quite good. But they don't always work, and let me say that having to reopen a browser with several dozen tabs (many of which have youtube videos and whatnot) can take rather awhile.

      I very much like the idea of each tab in its own process. Plus, this should work better on multi-core CPUs, which is also quite nice.

    13. Re:Processes by EvanED · · Score: 3, Interesting

      It isn't even new in the browser world. In fact it's where we started.

      Though it is pretty new for a mainstream browser to choose that as an explicit choice.

      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.

      Either you're lucky or I'm unlucky... there was a couple years when I was restarting Firefox probably about once a day on average because the memory use would shoot up to the point where it was basically unusable, and closing tabs basically didn't decrease that use.

      It's not nearly that bad now, but I still have plug-ins cause problems from time to time. And there are still times when doing something in one tab will cause the whole browser to freeze for a couple seconds, which gets a bit annoying if you're trying to listen to music or something.

      Every bandwagoner, technical lightweight is now stomping their feet that Firefox needs to get on this yesterday, but really this is pretty low on the list of things that make a real improvement in people's lives.

      Processes would solve the problems I alluded to first, but they are mostly gone anyway. Threads would help with the second problem. I do not feel that Firefox needs separate processes, but I really *do* feel that it would benefit from separate threads.

      (And in terms of the list of things that make a real improvement in people's lives, I would say that web browser improvements have basically stopped fitting that bill anyway. A thread per tab would, I think, be an improvement on par with almost anything FF3 brought to the table. Maybe Mozilla should have not done the awesome bar because that too is low on the list of things that make a real improvement?)

      Presuming that the sandbox of a browser automatically stops sites from doing stupid stuff (unlike IE that will let a site kill just by going into a perpetual loop in JavaScript)...

      Unfortunately, MS has yet to solve the halting problem. Maybe they should import Mozilla's module that determines if a Javascript loop is going to be perpetual too.

      (I'm being somewhat facetious here of course. I do appreciate Firefox's "this script is taking a long time to run" dialog. At the same time, I have definitely gotten that for legitimate scripts.)

    14. Re:Processes by ThePhilips · · Score: 4, Informative

      Threads historically were expensive because historically nobody used them. E.g. on Windows IO multiplexing had some history of bugs and didn't worked in the beginning - you had to use threads (and people used to use threads and even now use threads instead of NT's IO multiplexing). On *nix IO multiplexing worked more like always thus threads were (and are) used rarely.

      Now, since number of CPUs increased dramatically in recent years, threads were optimized to be fast: developers now throw them as panacea at any task at hand. (Most stupid use of threads seen in the month: start new thread for every child application to wait for its termination; due to stupid code, it still might miss its termination).

      As a system developer, I have went trhu user space parts of Linux 2.6 and Solaris 10 threads implementations (in disassembler; x64 and SPARC64 respectively) and can say that they are implemented well. (I was looking for example of atomic ops implementation.) Kernel parts of both Linux and Solaris are well known to perform extremely well, since they were tuned to support extremely large Java applications (and Java only now got IO multiplexing - before that threads were only option to perform multiple IO tasks simultaneously). HP-UX 11.x also didn't showed any abnormalities during internal benchmarks and generally its implementation is faster than that of Solaris 10 (after leveling results using speed of CPUs; SPARC64 vs. Itanic 2).

      But I guess "slow *nix threads" is now the myth of the same kind as "slow Windows process creation." (Problem is of course that process creation in Windows would always remains expensive compared to *nix. But not that those millisecons of difference matter much for desktop applications.)

      --
      All hope abandon ye who enter here.
    15. Re:Processes by spectre_240sx · · Score: 2, Insightful

      Chrome is doing more than browsers originally did. It's got a master process that's watching over everything else. The processes are also running at multiple different privilege levels. This may not be something that's absolutely new, but it does show innovation. There's nothing wrong with evolutionary progress. So-called "revolutionary" ideas often end up being less useful.

      I find that browsers will crash or hang fairly often if a page is poorly coded or a plugin reacts badly. Unfortunately, people will always make mistakes and there will always be things that are capable of crashing a rendering engine, but if separate processes are used, the effects can be limited to the tab / plugin that cause the problem. This opens up a lot of other potential separations. It would be great if they could separate text-boxes from the tab somehow so that if a tab went to hell, one's Slashdot post needn't go with it. Obviously you're not going to see a separate process for each input, but relegating all user-generated state to a process separate from the rendering engine might be a good idea.

      I'm having trouble understanding your argument about sandboxing, but it seems that you're for it. Separate processes greatly increase the degree of security in this case. Malicious coders would have to find a vulnerability in both the browser and the operating system to get around what Google is doing. If sandboxing is implemented in the browser alone, there's no operating system security to step in if there is a vulnerability in the browser.

      As for the javascript engine... Yes, Firefox's is faster, but it's also more mature. The architecture for V8 has a lot of potential and who knows what kind of speed increases we'll see after further development. Also, There may be reasons other than speed that make a full javascript virtual machine a good way to go. It's good to have competing solutions which drive innovation.

    16. Re:Processes by smartdreamer · · Score: 4, Informative

      Actually, threads are heavier in Windows than in every other OS including Linux, MacOSX and Singularity. Still they are way cheaper than a process and that is the whole point of their existence. As for .NET, it uses its own built-in threads model; .NET threads are different than OS threads.

    17. Re:Processes by apoc.famine · · Score: 4, Insightful

      Currently that's spelled "half of the internet". The other half is flash.

      --
      Velociraptor = Distiraptor / Timeraptor
    18. Re:Processes by Firehed · · Score: 3, Informative

      A few onclick events and ajax calls do not make up an application. Something that requires heavy debugging does, and chances are you're reinventing the wheel if that's the case in Javascript (see: jQuery, MooTools, etc).

      --
      How are sites slashdotted when nobody reads TFAs?
    19. Re:Processes by jc42 · · Score: 5, Informative

      Running each instance in a seperate process is NOT new technology

      Well of course. It isn't even new in the browser world. In fact it's where we started.

      And, as us old-timers know, this architecture was the basis of the original Bell Labs unix system, back in the 1970s. Lots of little, single-task processes communicating via that newfangled sort of file called a "pipe". That was before the advent of our fancy graphical displays, of course.

      Somewhat later, in the mid-1980s when we had graphical displays, the tcl language's tk graphics package encouraged the same design by adding to the usual unix-style pipes and forked processes. The language had a simple, elegant "send" command that would let a sub-process run arbitrary commands (typically function calls) inside the parent process using the sub-process's data. The idea was that you have a main process that is responsible for maintaining the on-screen window(s), but the work is done by the sub-processes. This design prevented blocking in the GUI, because the actions that would block were done in the other processes. The result was a language in which GUI tools could be developed very quickly, and would take maximal advantage of any parallelism supplied by the OS.

      But that was all decades ago, before most of our current programmers had ever touched a computer. Imagine if we only knew how to design things that way today. Is it possible that current software developers are rediscovering this decades-old sort of design?

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    20. Re:Processes by Johnno74 · · Score: 4, Interesting

      Ahh .net threads are regular win32 threads. They are scheduled by the OS, not the runtime. .Net code is (well, can be...) much, much more robust than c++ code as its managed, and type conversion errors, null references and other things can be caught and recovered from more gracefully than C++. This applies to Java too, of course.

    21. Re:Processes by Chrisje · · Score: 4, Interesting

      The funny thing is that I'm working on a shiny new HP 6910p laptop. The kind with ~6 hrs battery life, a good deal of memory, a fast CPU and even a decent GPU. Everyone goes on and on about how the "cost" to start different processes all the time is no longer significant, but I really noticed the difference. I run FireFox 3 with a whole bunch of plug-ins and a nice skin. That contraption, in spite of the plug-ins, feels quite a bit faster than the Chrome browser does out of the box. I've tested Chrome yesterday, and at the end of 6 hours of work (in which everything did work off the bat, even starting my Citrix apps from a web portal, kudos to that) I concluded that firefox feels leaner and meaner, and went back to it.

      One of the major gripes I have is that it feels like FireFox is much quicker with regards to my proxy. We run a proxy configuration script which gives us different settings depending on which office we're in, and in Firefox I never notice the damn thing running. Now in Chrome, whenever I open a new tab, I see the damn thing executing. New process, sandbagging (or whatever you call it)... bah, humbug. I agree with the parent poster. I can count the times when that would have come in handy on the fingers of one hand after 3 versions of firefox on my system, and it makes the experience noticeably slower.

      Cut a long story short: I appreciate it's a beta. Come release time I'll give it another whirr. But right now, I don't see what the big hubbub is about save the fact there's another Open Source competitor on the market, which is always good. What is funny is that when you de-install Chrome, a dialogue pops up asking "Are you sure you want to uninstall Google Chrome? - Was it something we said?"

    22. Re:Processes by donnielrt · · Score: 2, Interesting

      Each tab in a process is huge for me. Please don't presume that just because you've never faced a problem with one tab misbehaving, eating up resources and crashing the browser, nobody else does either.

      I don't give a flying fuck whether or not some browser in the past had tabs/windows as separate processes or not. What I care about is the fact that the best browser, at any point in time failed to have all the features I wanted. Chrome's coming damn close.

      Accidentally opening a PDF in the browser still almost brings Chrome to its knees (eventually it regains control and asks me if I want to close the Adobe PLUGIN (as opposed to just telling me that it's fucked and wants to restart, or that the tab needs to be closed). Considering that this is a first week beta, I'm awesomely impressed! I'm sure over time Chrome will evolve into a pretty slick and mature browser. I think Google has outdone itself this time.

    23. Re:Processes by HanoiAnon · · Score: 2, Insightful

      Funny. Firefox crashes every single day for me, usually 2-10 times per day. If I go to youtube, it's guaranteed to crash within an hour.

      It sure would be nice if it didn't crash my entire browser session every single time the current tab crashed (hint: flash. Hint2: Flash.)

      I would *@#$@*# kill for a browser that didn't suck quite as horrifically as firefox.

      Uh... So why are you still using it??

    24. Re:Processes by the_olo · · Score: 2, Informative

      Corollary: Revamp the plugin architecture so that plugins have to run in a separate process.

      I'm beginning to wonder if that fellow had any inside knowledge...

      Are you kidding? This idea is the subject of a popular, but ignored request for enhancement filed back in Mozilla's Bugzilla in 2002!

      It has 81 votes and 103 users on CC list. The idea is ages old, the successful implementation is new.

      Now if only Mozilla guys got to finally implement it in their browser... Otherwise you'll always get folks blaming the browser for crashes which are in fact caused by proprietary plugins.

    25. Re:Processes by apoc.famine · · Score: 3, Funny

      It's not reinventing the wheel if you don't know what the wheel is yet.

      Wait...did you expect someone replying to you on slashdot to know what the hell they were talking about?


      Well there's your problem...

      --
      Velociraptor = Distiraptor / Timeraptor
    26. Re:Processes by Tweenk · · Score: 2, Insightful

      Even better would be running just the plugins in separate processes. This way you don't even lose the tab that crashes Flash, only the problematic Flash video.

      --
      Those who would give up liberty to obtain working drivers, deserve neither liberty nor working drivers.
  3. So... by Anonymous Coward · · Score: 5, Insightful

    ...his argument that processes aren't really slower than threads anymore is because your processor is faster?

    1. Re:So... by moderatorrater · · Score: 3, Insightful

      Yep, kind of like how anti-aliasing isn't really slower than straight rendering any more because I've got a better video card.

    2. Re:So... by InlawBiker · · Score: 2, Funny

      Yeah, exactly. Why wait for programmers to come up with solid multi-thread code? $150 now gets you a dual-core CPU and 4gb or RAM. Just hope your browser doesn't crash while you're there....

  4. Oblig by plopez · · Score: 5, Funny

    "The 70's called...." I can't bring myself to say the rest....

    --
    putting the 'B' in LGBTQ+
    1. Re:Oblig by Anonymous Coward · · Score: 4, Funny

      1990 called, they'd like their joke back.

  5. Deja vu by overshoot · · Score: 5, Insightful
    I remember the "processes vs. threads" argument, but last time around wasn't it Microsoft arguing that a threaded process model was superior to an isolated task model like Linux had? Weren't the Linux camp blowing the horn for the superior robustness and security of full task isolation?

    My head hurts, I'm confused.

    --
    Lacking <sarcasm> tags, /. substitutes moderation as "Troll."
    1. Re:Deja vu by LWATCDR · · Score: 2, Interesting

      Well the truth it that Chrome might not be as slow under Linux as it is under Windows.
      If I remember correctly Windows is really slow at starting a new process while Linux is pretty fast. That was one reason why Apache was so slow on Windows and why they went to threads.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    2. Re:Deja vu by Anonymous Coward · · Score: 5, Interesting

      Windows people never really understood processes, they cannot distinguish them from programs (look at CreateProcess). They traditionally don't have cheap processes and abuse threads.

      In Linux we have NPTL now so there is a robust threads implementation if you need it. I don't thing processes are "superior" to threads (processes sharing their address space) or the other way round. They are for different purposes. If you need different operations sharing a lot of data go for threads I would say.

    3. Re:Deja vu by FishWithAHammer · · Score: 4, Insightful

      Both have pluses and minuses, as with anything. (I won't speak to the Unix model as I am not terribly conversant with it, but I know a good bit about the Windows model of threaded processes.)

      A threaded process model has one enormous advantage: you stay within the same address space. Inter-process communication is annoying at best and painful at worse; you have to do some very ugly things like pipes, shared memory, or DBus (on Linux, that is). Using the threaded process model, I can do something like the following (it's C#-ish and off the cuff, so it probably won't compile, but it should be easy to follow):

      class Foo
      {
          Object o = new Object(); // mutex lock, functionality built into C#
          SomeClass c = new SomeClass();
       
          static void Main(String[] args)
          {
              Thread t = new Thread(ThreadFunc1);
              Thread t2 = new Thread(ThreadFunc2);
              t.Start();
              t2.Start();
              while (t.IsRunning || t2.IsRunning) { Thread.Sleep(0); } // cede time
          }
       
          static void ThreadFunc1()
          {
              while (true)
              {
                  lock (o)
                  {
                      c.DoFunc1();
                  }
              }
          }
       
          static void ThreadFunc2()
          {
              while (true)
              {
                  lock (o)
                  {
                      c.DoFunc2();
                  }
              }
          }
      }

      In an isolated task model, this is nowhere near as simple. The problem, though, is that one thread can, at least in C++, take down the whole damn process if something goes sour. (You can get around that in .NET with stuff like catching NullPointerExceptions, but you'll almost certainly be left in an unrecoverable state and have to either kill the thread or kill the program.) The Loosely Coupled Internet Explorer (LCIE) model is forced to use processes to avoid taking everything down when one tab barfs up its lunch.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    4. Re:Deja vu by shird · · Score: 4, Insightful

      For the majority of local applications, a threaded model is superior. This is because local applications can be "trusted" in the sense they don't need to run each child thread sandboxed etc, so they gain the benefits of greater efficiency without worrying about reduced security. A browser is quite a different beast - it is effectively an OS to run remote "applications" (read: web 2.0 style web sites). So it kind of makes sense to run each as a seperate process.

      Windows the OS still runs each application in its own process. So it's not right to compare it to Chrome and argue that it doesn't use seperate processes, because it does - where it counts.

      --
      I.O.U One Sig.
    5. Re:Deja vu by ratboy666 · · Score: 4, Insightful

      Yes, you are correct. Unix started with a process model based on fork() and explicit IPC. Threads were "grafted on" later. It tends to result in more robust software (good multi-threading is HARD).

      In Linux a "thread" is a "process", just with more sharing. Thread creation is cheaper in Windows; process creation is cheaper in Linux. I tend to like the isolation that processes offer (multithreading brings with it the joy of variables that can appear to just change by themselves).

      There was never any good reason to NOT use multiple processes in a browser, except one. The GUI was "unified" amongst the browser Windows, and it has always been presumed that it would be too difficult to co-ordinate the drawing of multiple browsers. Also, the menu bars and controls would have to assigned to a separate process for each of the browsers. This can be done with an IPC channel, but that code would not have been portable between Unix and Windows at all.

      Since process creation was SO expensive in Windows (in days of old), the "thread" or "lightweight thread" approach was used instead (to maximize portability).

      It is an amazing testament to Google that they have achieved the multi-process, single UI model (I just don't know how they did the portability part).

      --
      Just another "Cubible(sic) Joe" 2 17 3061
    6. Re:Deja vu by The+Raven · · Score: 5, Insightful

      This is a misunderstanding of the application.

      Microsoft said 'Threads are better than Processes for a web server', where you're wasting a ton of resources creating a new process for every CGI script that's run. They were right! Now every major web server supports in-process applications that are created once per server (perhaps with a pool of shared app space) rather than once per request.

      Microsoft has never said that all the applications on your computer should run in one thread... that's just crazy talk.

      This is simply a decision by Microsoft and Google to treat a browser tab as an application, rather than as a document. Now that web pages do a lot more processing (and crashing), this makes more sense than the old way. There's nothing particularly bad about using threads instead... Firefox is just fine with threads, I see no reason for them to undertake a massive change due to misplaced hype.

      It really has to do with how much the processes share. If most of the memory per process could be shared, threads are probably more efficient. If not, processes. I'm no browser architect though, so I'll leave it up to Google, Mozilla, and Microsoft to make their own decisions.

      --
      "I will trust Google to 'do no evil' until the founders no longer run it." Hello Alphabet.
    7. Re:Deja vu by rrohbeck · · Score: 2, Interesting

      But the speed at which Chrome and IE8 spawn new processes depends on user interaction. Unless you use something like FF's Linky extension that allows you to open 99 tabs at a time, you won't notice a performance hitch. I don't think you can click faster than your system can start processes - unless it's *really* maxed out and/or paging. Which, BTW, happened to me just yesterday when FF3's VM size approached 1GB (after a week or so.) Killing the process and letting it restore windows and tabs reduced the VM size to 200-something MB.

    8. Re:Deja vu by aspx · · Score: 5, Funny

      You just defended Microsoft on Slashdot and you got modded +5 Insightful. I will follow you anywhere, O great one!

    9. Re:Deja vu by ozphx · · Score: 2, Informative

      As a minor nitpick, Sleep(0) can return immediately. You'll end up with the main thread burning CPU in a tight loop if nothing is waiting.

      Thread.Join would be more appropriate, or using Monitor.* manually.

      --
      3laws: No freebies, no backsies, GTFO.
    10. Re:Deja vu by FishWithAHammer · · Score: 2, Insightful

      I forgot about longjmp, my bad. That said, with longjmp you can come back from it, *sort of*, but as you said, you can't really guarantee program state, and so that's not really very useful.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
  6. Only one benefit discussed: isolation by michaelepley · · Score: 3, Informative

    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.

    1. Re:Only one benefit discussed: isolation by ceoyoyo · · Score: 4, Insightful

      From the other perspective, having used IE in the past, I know how easy it is for a page to open lots of popups. In fact, you could open so many popups that it would crash the browser.

      Now that the browser likes opening new processes, an out of control web page can crash my whole OS instead?

    2. Re:Only one benefit discussed: isolation by FishWithAHammer · · Score: 2, Interesting

      Er, wha? Threads will regularly kill a process when they're in a bad state in any sufficiently complex program, and given how nasty handling the Web can be, it really doesn't surprise me that web browsers crash.

      Processes are both easier to use from a developer's point of view (because I assume part of LCIE is a developer-invisible shared memory model) and somewhat safer than just using threads. It's still possible to crash them, of course, but it's harder to crash than when using a threaded-process model

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
    3. Re:Only one benefit discussed: isolation by Sloppy · · Score: 3, Interesting

      tabs running in separate threads shouldn't bring down the entire browser, if the application was properly designed in the first place

      Big internet client applications are never properly designed in the first place.

      I don't say that as a cynic; it's just that they are so damn big and pull in so many libraries, etc. When you're writing a web browser, you don't have time to write a GIF decoder, so you're going to use someone else's library. This type of thing happens over and over, dozens of times. You just can't audit all that code. But if there's a buffer overflow bug in just one of those libraries...

      What excites me about this multiprocess approach isn't just the fact that we can recover from hung javascript. That's just a populist example. What I look forward to, is the problem getting split up into even more processes, with some of those processes running as "nobody" instead of the user, or some of them running under mandatory access controls, etc.

      All that crap will never be fully debugged, so let's acknowledge that and protect against it.

      Chrome's sandboxing is just the tip of the iceberg compared to what is possible, but it's a step in the right direction and (dammit, finally!!) has people talking about sandboxing as something to really work on. A thousand programmers all over the internet are going to adopt a trend that just happens to be a good trend. Thank you, Google.

      --
      As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
  7. Chrome = slow as hell by Xaximus · · Score: 3, Interesting

    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.

    1. Re:Chrome = slow as hell by B3ryllium · · Score: 5, Informative

      "to load 8 sites" ... 8 sites that you visit frequently and thus have cached on your Firefox installation, perchance?

      Don't be so rash to judge. Chrome has many other areas where it lacks compared to Firefox, speed isn't generally one of them. I've heard many users say that it loads pages more than twice as fast as Firefox, and also scrolls much faster on graphical/data-intensive pages.

      The lack of extensions (such as adblock, firebug/firephp, flash block, noscript, coloured tabs) is the main reason why I've barely used it since I installed it.

    2. Re:Chrome = slow as hell by B3ryllium · · Score: 2, Insightful

      Indeed! So the OP is that much more of a drama queen for uninstalling it in "5 minutes".

    3. Re:Chrome = slow as hell by AbRASiON · · Score: 2, Informative

      Something is wrong with your PC then.
      I love FF and have no interest in chrome without all the addons FF provides.
      That being said chrome was insanely fast, really, really fast - easily the fastest web browser I've ever seen, including clean instealls of FF1 / 1.5 / 2 and 3.

  8. There's another cost to seperate processes by sqlrob · · Score: 2, Interesting

    AV slowing the start of each process is really going to cause a performance hit.

  9. Cheap and Dirty Crash Isolation... by nweaver · · Score: 5, Insightful

    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
    1. Re:Cheap and Dirty Crash Isolation... by lgw · · Score: 2, Interesting

      And yet the now-famous :% crash takes down all of Chrome, not just the current tab. I had a chance to ask a Chrome developer about that, but I didn't get an answer. Perhaps crash-isolation isn't as good in practice as one would think, or perhaps that was just another "oops" on the part of the Chrome dev team, and we'll get real crash isolation in the next release.

      --
      Socialism: a lie told by totalitarians and believed by fools.
  10. Um, it's really a red herring by Estanislao+Mart�nez · · Score: 2, Insightful

    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.

    1. Re:Um, it's really a red herring by Anonymous Coward · · Score: 2, Insightful

      That maybe true on windoze. Linux has had fine-grained control of resource sharing between processes/threads for ages - clone(), mmap() etc. Modern linux threads are implemented as processes at the kernel level, in fact. The idea that "processes are slow" is windowsitis, like "command lines suck" - windows processes may be slow, the windows command line may suck, but processes or command lines in general don't necessarily suck.

  11. Limitations by truthsearch · · Score: 4, Insightful

    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.

    1. Re:Limitations by corerunner · · Score: 2, Insightful

      In complete seriousness, what reason is there to ever have hundreds of tabs open? I use typically have 2 browser windows per workspace, and up to 4 workspaces, but even with 20 tabs per window that's still only 160 tabs distributed across the equivalent of 8 monitors! How could anyone possibly remember where to find the site he is looking for in 400 tabs? Maybe I'm missing something...

      --
      "Don't hate the media, become the media." -Jello Biafra
  12. Share nothing procesesses by Safiire+Arrowny · · Score: 2, Insightful

    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.

  13. Re:Hilarious... by dzfoo · · Score: 2, Informative

    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
    ...Can you save Christmas?
  14. Processes in Vista by hardburn · · Score: 4, Informative

    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
    1. Re:Processes in Vista by bluefoxlucid · · Score: 5, Informative

      The basic reasoning goes that Linux has an awesome processes model because its thread model sucks,

      NPTL has scaled to hundreds of millions of threads created in under 10 seconds on common hardware....

  15. IPCommunications overhead? by Urban+Garlic · · Score: 2, Interesting

    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
  16. Slow to start a process!? by Sloppy · · Score: 4, Insightful

    They [processes] 're slow to start up

    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.
  17. Um, duh by coryking · · Score: 2, Funny

    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.

  18. Erlang Browser by bjourne · · Score: 2, Informative

    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. :)

    1. Re:Erlang Browser by FishWithAHammer · · Score: 2, Informative

      It has nothing to do with Erlang and everything to do with basic design principles. Erlang did not invent what it preaches.

      --
      "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
  19. Requirements/Trade-offs by bill_mcgonigle · · Score: 4, Insightful

    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)
    1. Re:Requirements/Trade-offs by bill_mcgonigle · · Score: 2, Informative

      A single process (single-threaded or multi-threaded) would have OS limits on the open file/socket descriptors much lower than 100000.

      I haven't tried it yet myself but supposedly erlang servers do this kind of thing regularly. Somebody here probably knows if you use ulimit or whatever to tune that.

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    2. Re:Requirements/Trade-offs by FooBarWidget · · Score: 4, Informative

      "If you're writing a server to handle 100,000 connections simultaneously you probably want to use threads."

      Actually, if you want to scale to 100000 connections then you will *not* want to use threads. Google "C10K problem".

  20. Another Benefit: Killing Bad Pages by ink · · Score: 2, Interesting

    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.
  21. quite ironic by speedtux · · Score: 4, Interesting

    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)? :-)

    1. Re:quite ironic by the_B0fh · · Score: 4, Insightful

      And debugging threads is easy? Oh boy, talk about a crack pipe.

  22. Re:It's different this time around... by ShadowRangerRIT · · Score: 2, Insightful

    Wrong. If a process has affinity fixed to a single core, then its threads will be similarly constrained. But threads on an unconstrained process will happily move between cores; that's why you can get really aggravating race conditions on multi-proc machines that don't appear for the same multi-threaded program on a single core machine.

    Also, Apache and the like allow the option of threads vs. processes. Traditionally, Windows installs use thread and *nix installs use processes because Windows is optimized for threads and *nix for processes, though it only matters if the server is under load.

    --
    $_ = "wftedskaebjgdpjgidbsmnjgcdwatb"; tr/a-z/oh, turtleneck Phrase Jar!/; print
  23. Testament indeed by overshoot · · Score: 2, Insightful

    It is an amazing testament to Google that they have achieved the multi-process, single UI model (I just don't know how they did the portability part).

    It's not altogether clear that they have ...

    --
    Lacking <sarcasm> tags, /. substitutes moderation as "Troll."
  24. Could someone give the gory details by melted · · Score: 2

    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?

    1. Re:Could someone give the gory details by Shin-LaC · · Score: 5, Informative

      I went looking for the same information earlier today. Surprisingly, the design document titled "How Chromium Displays Web Pages" doesn't shed any light on that, at least at this time. You have to dive into the source to find out.

      Basically, a single process (the one main browser process) owns the window and draws to it. Renderer processes draw their web content into shared memory; the browser process then transfers the data into a backing store, which it uses to paint the window. The process is coordinated via inter-process message-passing (using pipes, it seems), but the rendering output travels via shared memory.

  25. google comic strip by Danzigism · · Score: 2, Interesting

    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*
  26. Re:victory of tabbed browsing - not defeat of thre by caerwyn · · Score: 2, Informative

    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