Wednesday, 22 November 2017

WHAT IS .NET CLR

CLR is the core component of .NET FRAMEWORK.
CLR stands for Common Language Runtime. It is an execution environment and provides a layer between Operating Systems and the applications written in .Net language that conforms to the CLS (Common Language Specification).

    CLR is responsible for converting 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 CLR’s JIT compilation converts MSIL to native code on demand at application run time.
 CLR is platform dependent. When .Net application is executed the request will goto operating system. Operating System will create memory process and IL instructions will be loaded. Operating System will load CLR to process IL instructions.
It is a software comes with MSCOREE.DLL . It resides in C:\WINNT\SYSTEM32.

The CLR is a Platform Dependent, because it produces the code that the operating system understands. . i.e., O/S Native Code.

O/S should maintain an application for calling CLR. This application is called as “RUNTIME HOST”.

The Runtime Host for Desktop application will be an API function called “CORBIND TO RUNTIME”.

The Runtime Host for Web application will be “ASP.NET WORKER PROCESS”.

The .NET Assembly will maintain CLR HEADER which will contain the Version of Runtime Engine to be loaded.
And CLR is a Runtime Engine that provides various services :


The services include :

ASSEMBLY RESOLVER:- It will read Manifest of the application and will locate files required for the application.This will forward request to ASSEMBLY LOADER.

ASSEMBLY LOADER :- It will LOAD all files required for the application.

TYPE CHECKER :- This will verify the TYPES used within the application with CLS standards. This will provide Type Safety.

DEBUG MANAGER :- When the application is terminated with runtime error, DEBUG MANAGER service will activate Debugger utility for line by line execution. This will allow the Developer to make the changes without stopping the execution.

EXCEPTION MANAGER :- This will verify Exception Class Object with Catch Blocks. If it is not Handled ,it will terminate the application.

COM MARSHALLER :- This will provide Interoperability with COM. i.e.,
Communication with COM RUNTIME.

THREAD SUPPORT :- This will share Processor time for more than one execution path within a single application process.
This will provide MultiThreading support.

GARBAGE COLLECTOR :- It will destroy unused objects. This will provide Automatic MEMORY MANAGEMENT under .NET Framework.

IL TO NATIVE COMPILER :- This is called as JIT(Just In Time) Comiler.

This will convert IL into O/S understandable code.

Finally O/S executes the code.

No comments:

Post a Comment