IIS, application domains, pools, processes and threads, high level understand

application-poolsiisprocessthreads

Was hoping if someone could be all these things into perpective for me.

This is to better understand operatig systems in general, but also specifically how it applies to IIS.

How to application domains, app pools, processes and threads come into play in a web application?

Is it like this:

An application pool can have multiple application domains.

A domain can have multiple processes, and each process manages a pool of threads. The threads share memory space in the process.

Also I'm interested in linxu (ubuntu) servers so if it is similar or different that would be interested to know.

Best Answer

An App Pool can contain multiple IIS Applications.

An IIS application is a set of related pages that shares the same state - Application and Session variables are shared, for example. You app-ify or de-app-ify through the UI.

An IIS Application may have zero or more AppDomains. An AppDomain is like a lightweight process-within-a-process, but it's a .Net-specific concept; ASP apps don't have AppDomains, ASP.Net apps do.

An App Pool runs in one or more Worker Processes (w3wp.exe). A process is essentially a container for memory, and has an identity (a token) associated with it, and one or more threads.

A thread is a "thread of execution" - a distinct set of CPU state and an operation chain that runs on the memory within a process. Threads can have a token associated with them (when they impersonate a user, for example), which overrides the process identity for operations by that thread, until the thread stops impersonating. If the thread "loses" its token, it acts as the process identity.

The book you should read is called "Windows Internals" http://technet.microsoft.com/en-us/sysinternals/bb963901.aspx by Solomon, Russinovich and Ionescu.