What Is the Common Language Runtime?
The common language runtime (CLR) is the engine in the core of managed code execution. The runtime provides various services for managed code, such as cross-language integration, code access security, object lifetime management, debugging, and analysis support. It is the core of the entire .NET framework, and it provides a managed code execution environment for .NET applications. It is actually a piece of proxy code that resides in memory and is responsible for the code management of the application throughout its execution.
- The Common Language Runtime (CLR) is the core of the entire .NET framework, and it provides a managed code execution environment for .NET applications. It is actually a piece of proxy code residing in memory. It is responsible for the code management of the application during the entire execution period. It is more typical: memory management, thread management, security management, remote management, even if compiled, code enforcement security Inspections, etc., can all become the lifeline of the .NET framework. [1]
- (1) Class loader: manage metadata, load and layout classes in memory;
- (2) Micorsoft Intermediate Language (MSIL) to Native Code Compiler: Micorsoft Intermediate Language is converted to native code through on-the-fly compilation;
- (3) Code manager: manage and execute code;
- (4) Garbage collector: Provides automatic lifetime management for all objects under NET.Framework, supports multiple processors, and is scalable;
- (5) Security engine: Provide evidence-based security, based on user identity and code source;
- (6) Debugger: enables developers to debug applications and execute according to code;
- (7) Type checker: Do not allow unsafe type conversion and uninitialized variable MSIL can be checked to ensure type safety.
- (8) Exception manager: provides an exception handling mechanism integrated with Windows structured exception handling;
- (9) Thread support: Provide multi-threaded programming support;
- (10) COM marshaler: provides marshaling conversion between COM components;
- (11) .NET Framwork class library support: Supports .NET Framwork class library by integrating code with runtime. [1]
- The functions of the common language runtime pass
- Cross-language integration, especially cross-language inheritance.
- Garbage collection, which manages the lifetime of objects, makes
- 1. will
- (1) Performance has been improved;
- (2) Can easily use components developed in other languages;
- (3) Extensible types provided by the class library. [2]
- (4) New language features, such as inheritance, interface, and overloading of object-oriented programming; explicit free-thread processing support that allows the creation of multi-threaded scalable applications; structured exception handling and custom property support. [5]
- If you use Microsoft & reg; Visual C ++ & reg; .NET, you can use C ++ managed extensions to write managed code. C ++ managed extensions provide the advantages of a managed execution environment and access to powerful features and expressive data types you are familiar with.