Graphic DOTNET framework: Compilation and execution engine (below)

Source: Internet
Author: User
Tags dotnet mscorlib

(Disclaimer: this series is intended for you only. the Net Framework is not an explanation of syntax and class usage. Therefore, you can only briefly describe the mentioned classes. If you have any questions, go to msdn to check)

 

In the previous article, we explained the theme, CTS,ProgramSet and other content, and leave a problem, that is, how to cross-platform. net, we will understand this problem now. Due to limited space, please refer to the figure in the first article.
According to the flowchart, we will explain mscoree. dll.

Mscoree. dll is loaded by related. Net processes. For the related processes, we will continue to explain winform and ASP. NET later.
Mscoree. DLL: The execution engine of the Common Object Runtime Library. it is up to him to find the location of all the DLL to be loaded and load them (must contain mscorlib. DLL is the core class library and contains a large number of core types, such as system and system. io ). then read the metadata in the Assembly. so mscoree. DLL is also called the CLR gasket.

CLR: Common Language Runtime Library. we have already started his gasket.. NET is the CLR, just like a Java virtual machine ,. net without him, it becomes a disability, huh, huh. in mscoree. after a DLL is loaded, the CLR loads the corresponding DLL (mscorwk. DLL or mscorsrv. DLL. the reason for the good performance of. net), and then the CLR will layout the data type in the memory, and use the JIT to compile the association into the commands of a specific platform. hey, you may have guessed it. net is cross-platform. because. net DLL is actually compiled by the JIT of each platform into machine commands at runtime. so naturally, you can use the cross-platform interface.

GC in CLR: Garbage Collector. we know. net generally does not need to manually release resources. People who have done c ++ know what it means to manually release resources: inexplicable errors, endless abyss ...., in. all of the managed resources in. NET are cleaned by GC. in CLR, "object graph" and "Generation" of the object are created ".
1. If the object is white, check whether the object can be referenced.
2. this concept is used to help GC quickly check which objects are not referenced. net contains 0, 1, and 2 generations. 0 is a newly created object. 1 is a referenced object after a recycle is executed. 2 is an object that has been recycled more than once and has not been cleared. GC is always collected from generation 0. If the memory is sufficient, the first generation is not operated. Otherwise, check whether the first generation has no referenced objects. execute recycling. If not, clean up the second generation.

Let's take a look at how GC works:

Abcdf is marked as generation 0

We now recycle the 0-generation objects because BF is not referenced, so they reclaim their memory and compress the managed heap.

Now ACD is marked as generation 1

If ACD is not recycled again, it is marked as 2 generations. OK. Now we understand how GC releases resources.

. Net Process:. the. NET process contains multiple application domains. the key feature of operating system independence on the. NET platform. Compared with the complete process, the CPU and memory of the application domain are less occupied. Therefore, the CLR loads and unmounts the application domain (appdomain) it is much faster.
Application domain (appdomain): contains multiple required DLL and context, that is, each appdomain has mscorlib. DLL and other DLL, after this step, it should be a specific application, such as ASP.. net, WPF, and other forms of applications.ArticleWill introduce their framework, and finally integrate it, is complete. net Framework. Before that, let's take a look. net important DLL, give new people a basic, Masters don't need to read, but hope the experts can give advice.

 

The following sections describe the commonly used DLL in. net, and then illustrate various applications.

 

Next article:. NET Framework and architecture mode and design mode series (Graphic DOTNET framework) II:. Net basic data types (differences between reference and value types), functions of system. dll
 

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.