The first part of "clr.via.c# Third Edition" Reading notes (i)

Source: Internet
Author: User

The book "clr.via.c# third Edition" has recently been studied. Reading a PDF document is really tiring. Suggest a qualified friend or buy a book to read it.

My notes are used to record my understanding of the book, to simplify the logic, and to summarize what I think is the main point of each part. The special basis of things will not do too much elaboration.

The first part is about the CLR Foundation.

Let's start with the concept of the CLR: "The CLR is a runtime that can be used by multiple programming languages." You can use any programming language to develop your code, as long as the compiler is oriented to the CLR. " This is to be re-interpreted as "as long as the compiler is for the CLR". Beginners generally disagree with the. NET platform across languages, or so-called "cross-language" languages that are within the scope of Microsoft's rollout. This understanding is in fact wrong. Any language can target the CLR to create its own compilers. We are familiar with iron Ruby, Perl, and PHP have CLR-oriented compilers. Figure 1-1 shows the process of compiling the source code files.

The more important perception is that the CLR actually does not work with the managed module, but rather works with the assembly. The assembly contains other files such as managed modules and resource files.

IL (intermediate language) can be written using assembly language. The JIT in the CLR (just in time) is also called an instant compiler, which has a function jitcomplier (), the function of which is to convert the Il of the method to be executed cost to the CPU instruction.

The calling procedure for a method in a class:

When a method executes, it is generally called two times. (The tentative method here is named Test ())

First Call:

Jitcompiler () compiles the IL Code of the test () method to compile the cost of the CPU instruction (this instruction is saved in a dynamically allocated memory block), and the test () method executes through Jitcomplier in the memory block (including the Il of the lookup method ) , verify the Il of the method, compile, execute).

Second call:

Skip Jitcompiler () completely, and the Test () method executes again in memory.

Two executions of the process 1-4, 1-5 as shown:

Note that the local CPU instructions are stored in dynamic memory, and once the program terminates, the local CPU instructions are discarded.

The difference between the debug version and release version is essentially whether the IL code quality and the JIT native code quality are optimized. From the performance considerations, the program deployment, release, preferably with release version.

This section also contains program packaging, deployment, assembly information, and so on. There is no elaboration here.

The first part of "clr.via.c# Third Edition" Reading notes (i)

Related Article

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: 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.