CGISecurity Logo

Microsoft IE8 and Google Chrome – Processes are the New Threads

"I happened to install Google Chrome (Alpha) the same day I installed
Internet Explorer 8 (Beta). I noticed immediately, as I’m sure many of
you have, that both browsers isolate tabs in different processes.

Unix
folks have known about the flexibility of forking a process forever. In
Unix, fork() is just about the easiest thing you can do. Also,
fork()ing in Unix will copy the whole process and all variables into a
new space. Everything after the fork happens twice. Multitasking made
easy.

In Windows, you call CreateProcess() and you don’t get a
copy or clone. You just start up a whole new universe, starting from
the very beginning – NOT from the call to CreateProcess().

What processes in Windows and Unix do have
in common is that they each get their own protected virtual memory
space. They are all alone and isolated. If a process crashes it’s less
of a crisis than if a thread within a process crashes.

(In
.NET, AppDomains are like mini-processes, but they just aren’t as
completely isolated as a process is, so you can still bork an AppDomain
enough that the whole process dies.)

Why does all this
matter? Well, back in the day, most folks on Windows would recommend
that developers interested in multi-tasking use threads. There’s even
been talk about fibers (really tiny threads within threads…like
superstrings 😉 ) However, darnnit, processes are easy.

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. There’s
this thing called Moore’s Law that keeps marching on. Making a new
process and talking to it in any of the myriad IPC (Inter-process
Communication) methods available just isn’t that much of a problem
these days. Just open up Process Explore and enter "Tree View" sometime
to see how many programs you use every day are actually multiple .exe’s
working together.

You can learn more about IE8 and how their multiple-process model works in both IE7 and IE8. (IE7 had this process isolation feature also…except one tab per security zone.)

You can learn more about Chrome and how they talk between their multiple "Render" processes in this architectural overview. They are using named pipes if you were wondering how Chrome talks to itself."

Read more ore this article: http://www.hanselman.com/blog/MicrosoftIE8AndGoogleChromeProcessesAreTheNewThreads.aspx