.Net Framework CLR Overview

The CLR stands for Common Language Run time is an Execution Environment. It works as a layer between Operating Systems and the applications written in .Net languages that conforms to the Common Language Specification (CLS). The main function of Common Language Run time (CLR) is to convert the Managed Code into native code and then execute the Program. The Managed Code compiled only when it needed, that is it converts the appropriate instructions when each function is called. The Common Language Run time (CLR)’s just in time (JIT) compilation converts Intermediate Language (MSIL) to native code on demand at application run time.

When .Net application is executed at that time control will go to Operating System, then Operating System Create a process to load CLR
The program used by the operating system for loading CLR is called run time host, which are different depending upon the type of application that is desktop or web based application i.e.The run time host for desktop applications is API function called CorbinToRuntime.
The run time host for web based applications is asp.net worker process (aspnet-wp.exe).

CLR run time engine comes with set of services, which are classified are as follows
  1.  Assembly Resolver
  2.  Assembly Loader 
  3. Type Checker 
  4. COM marshaller 
  5.  Debug Manager 
  6. Thread Support 
  7.  IL to Native compiler 
  8.  Exception Manager 
  9. Garbage Collector 
let us know about these services in brief.

Assembly Resolver

Assembly resolver will read manifest of application, it will identify private and shared assembly required for application execution, the request will be send to assembly loader. 
 Assembly Loader 
Assembly loader will load assembly into application process based on assembly resolver instructions.

Type Checker

Type checker will verify types used in the application with CTS or CLS standards supported by CLR, this provides type safety.

COM marshaller

COM marshaller will provide communication with COM component, this supports COM interoperability.

Debug Manager

Debug Manager Service will activate debugger utility to support line by line execution; the developer can make changes as per requirement without terminating application execution.

Thread Support
Thread support will manage more than one execution path in application process. This provides multi threading support.

IL to Native compiler

IL to native compiler is called JIT compiler (just-in-time compiler), this will convert IL code into operating System native code.

Exception Manager

Exception Manager will handle exceptions thrown by application by executing catch block provided by exception, it there is no catch block, it will terminate application.

Garbage Collector

Garbage Collector will release memory of unused objects, this provides automatic memory management.
Summary
This is the brief introduction about the CLR, In future i will write the detail article about each services’ hope it’s helpful for all readers.

3 comments

Post a Comment

www.CodeNirvana.in

Protected by Copyscape Online Copyright Protection
Copyright © Compile Mode