NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Introduction to Application Domains

Operating systems and runtimes typically provide some form of isolation between applications running on the system. This isolation is necessary to ensure that code running in one application cannot adversely affect other unrelated applications. In Windows, this isolation has historically been achieved using process boundaries. In this model, a process runs exactly one application and that process scopes the resources that are available for that process to use. For example, memory addresses in Win32 are process relative - a pointer in one process is meaningless in the context of another process. The NGWS runtime has similar needs for isolation, but there are many scenarios where the process boundary is too heavy weight. Additionally, the NGWS runtime can rely on the fact that user code can be verified to be type safe to help provide isolation at a lower cost than the process boundary.

The NGWS runtime allows multiple applications to be run in a single Win32 process. A construct called an Application Domain is used to isolate those applications from one another. In many respects, Application Domains are the NGWS runtime equivalent of a Win32 process.

Specifically, isolation means:

The primary goal of this document is to describe how the NGWS runtime uses Application Domains to achieve these goals. In addition, the document also describes how domains are created and manipulated by hosts, and how threads, GC heaps, remoting, and class loaders relate to domains.