Transcript of managed code and unmanaged code

Source: Internet
Author: User

Some time ago, when the younger brother reviewed, he copied some sentences that he thought would be helpful to understanding the Management Code. This post is here, hoping to help anyone who needs it. These replicas are mainly for the definition of managed code and the advantages and disadvantages of managed code and unmanaged code. They also mention how it works in CLR.

 

Statement in advance: these transcripts (definitions) are mainly from the following books (articles)

1. Programming in. Net Environment

2. Shared Source CLI

3. Essential. net

4. Instructor handouts (by David Gray & Rob miles)

5. Internet (Google.com)

 

Again, this is a transcript. It is only used for your learning and communication. If you want to use the original text, please indicate the source. Thank you.

 

2 virtual execution in the CLI occurs under the control of its execution engine, which hosts components (as well as code that is not component base) by interpreting the metadata that describes them at runtime.Code that runs in this way is often referred to as managed code.

 

2. managed code is code that has its execution managed by the. NET Framework CLR.

 

² When we talk about 'managed Code', we are talking about'Virtual execution environment'. By this we mean that the environment in which our programs runs is artificial, and removed from the underlying hardware. the environment takes the form of a program which plays the role of the supporting computer.

 

² Any of the versions that target the runtime produce managed code emitted as PE files that contains Il and metadata. before the code is run, the Il is compiled into Native executable code. and since this compilation happens by the Managed execution environment,The Managed execution environment can make guarantees about what the code is going to do.

 

2. Managed Application written to take advantage of the features of the CLR perform more efficiently and safely, and take better advantage of developer's expertise in advance ages that support the. NET Framework.

 

2. managed code runs completely inside the. NET Framework, without relying on other resources such as COM components. The CLR translates managed code to executable code, which the CPU then executes.

 

2. Unmanaged executable files are basically a binary image, x86 code, loaded into memory. the program counter gets put there and that's the last the OS knows. there are protections in place around memory management and port I/O and so on, but the system doesn't actually know what the application is doing. therefore,It cannot make any guarantees about what happens when the application runs.

 

² Unmanaged code does not run inside the. NET environment, therefore,It cannot make use of any. Net managed facilities.

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.