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

16 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 dwywit · · Score: 5, Funny

      What, something like hawking fell ?

      --
      They sentenced me to twenty years of boredom
  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 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.

    3. 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.
  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?

  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+
  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 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.

    2. 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.
    3. 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!

  6. 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
  7. 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....

  8. 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.

  9. 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.