Sunday 29 September 2013

.NET AppDomains and why Threads are Special

.NET AppDomains and Their Relationship to Processes, Assemblies and Threads

An Application Domain , or AppDomain, in .NET, provides a boundary wall between running .NET applications, to enhance reliability and security. They are like discrete pinball machines.

AppDomains and Processes; Plus Points of Partitioning Arrangement

AppDomains are structured such that several of these domains may be run in a single process; in math terms, the process space is partitioned into AppDomain space i.e. can have several of these non-intersecting AppDomains that make up the process space. This avoids the "resident" applications from the overhead of making inter-process calls when they need to communicate (everyone is in the same process "locale").

AppDomains and Assemblies

A .NET assembly must be loaded into an AppDomain in order to be able to run. A typical application will load several assemblies into a single AppDomain.

AppDomains and Threads

A thread must run in an AppDomain, but has the ability to cross into other AppDomains. They are bit like electrons within atoms.(Thread.GetDomain will tell you what AppDomain a thread is currently running in).

No comments: