Remoting basic principle and extension mechanism (next)

Source: Internet
Author: User

Let's begin by understanding the following basic concepts before starting this section.

application domain

application domains, often referred to as AppDomain, can be considered as a lightweight process. You can include multiple appdomain within a Windows process. The concept of AppDomain is proposed to enable multiple applications to be hosted on a single physical server, and these applications can be independent of each other. Asp. NET is an example of using AppDomain to host multiple Web applications within the same process. In fact, Microsoft has had a stress test that hosts up to 1000 simple Web applications in a single process.

The performance advantages obtained by using AppDomain are mainly embodied in two aspects:

• Less system resources are needed to create a AppDomain than to create a Windows process.

• Sharing resources between AppDomain hosted within the same Windows process, such as the CLR, Basic. NET type, address space, and threads.

The independence of each AppDomain is embodied in the following characteristics:

• A appdomain can be unloaded independently of other AppDomain.

• One AppDomain cannot access other AppDomain assemblies and objects.

• If no cross boundary exception is thrown, a AppDomain has its own independent exception management strategy. This means that a problem within a AppDomain does not affect other AppDomain in the same process.

• Each AppDomain can define a separate assembly code access security policy.

• Each AppDomain can define separate rules so that the CLR locates the assembly location before loading.

You can see that the application domain is a child unit in the process, but in the. NET also has a finer-grained unit than the application domain ——. NET contexts (context).

. NET Context

A. NET application domain can contain more than one called. NET context. All. NET objects exist in the context, and there is at least one context in each application domain. This context is called the default context for the application domain, which is created when the application domain is created. The following diagram summarizes the relationships between them:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.