473,548 Members | 2,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need a clear explanation of CLR,MSIL and JIT?

My understanding is the MSIL runs on the CLR and the CLR is basically
the JIT compiler plus Garbage collection. This part "MSIL runs on the
CLR" is a bit vague to me can anyone give me a clearer definition and
explain how these 3 work together.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
4 19121
MSIL = ms intermediate language
CLR = common language runtime
JIT = Just in time compiler

MSIL is the "machine code like" language that the C# compiles your code
into.
The CLR is the "machine" that the MSIL runs on.
When runinng the MSIL the CLR converts your code into *real* machine code
using the JIT.
In this context just in time stands for that only the MSIL needed for the
moment is beeing compiled into machine code.
The real machine code is run on yor computers actual CPU.

Hope this helps.
mortb
<James dean> wrote in message news:O7******** ******@TK2MSFTN GP14.phx.gbl...
My understanding is the MSIL runs on the CLR and the CLR is basically
the JIT compiler plus Garbage collection. This part "MSIL runs on the
CLR" is a bit vague to me can anyone give me a clearer definition and
explain how these 3 work together.

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #2

"mortb" <mortb1<noospam <@hotmail.com > wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
MSIL = ms intermediate language
CLR = common language runtime
JIT = Just in time compiler


And as a sidenote:

ECMA (and later) ISO never bought using MSIL when .NET was formally made
into a standard.
Hence, MSIL was swiftly renamed into CIL.

CIL = Common Intermediate Language.

Happy Coding
- Michael S
Nov 17 '05 #3
test
<James dean> wrote in message news:O7******** ******@TK2MSFTN GP14.phx.gbl...
My understanding is the MSIL runs on the CLR and the CLR is basically
the JIT compiler plus Garbage collection. This part "MSIL runs on the
CLR" is a bit vague to me can anyone give me a clearer definition and
explain how these 3 work together.

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #4
When you compile a .NET language it generates an assembly. This assembly contains the IL instructions. When you run a .NET program, the win32 loader loads the CLR and hands off control to it. The CLR loads the assembly and locates the entrypoint (Main). The processor can't execute IL so the CLR invokes the JIT compiler to compile the method to machine code - all methods called from Main are stubbed out. The machine code is now executed by the processor. When the code path takes it into one of the stub functions, the JIT compiler is re-invoked to compile the new method (and it's called methods are stubbed out).

During the execution of the code, objects are created causing memory allocation. This memory is allocate on an area of memory called the managed heap. Because this block of memory is not infinite, eventually an allocation will cause a threshold to be breached where the CLR decides memory must be reclaimed. The Garbage Collector is invoked and it walks through the objects that are still potentially in use in the application and marks them as still in use. The memory for every object not marked as in use can then be reclaimed (the GC process is much more involved than this but this is broadly the approach).

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

My understanding is the MSIL runs on the CLR and the CLR is basically
the JIT compiler plus Garbage collection. This part "MSIL runs on the
CLR" is a bit vague to me can anyone give me a clearer definition and
explain how these 3 work together.

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
4553
by: Raymond Lewallen | last post by:
Is there some article out there that helps in reading MSIL? I've been looking but can't find anything, and I'm probably just looking in the wrong spots for the wrong keywords. I understand mov, call, jmp, ptr, dword and some of the other obvious pieces. I'm looking to understand some of the less obvious pieces of MSIL so I can better...
7
1740
by: Raymond Lewallen | last post by:
Microsoft, Can I make a request for a newsgroup specific to MSIL? I have taken great interest in MSIL and have done a lot of reading into MSIL, and written, compiled and tested with success a few il programs. I'm sure this is a topic of interest to many people, as it is at the heart of .Net. If any of you readers/posters are also...
6
2937
by: TrickyDicky | last post by:
Hi all, I'm just starting to experiment with MSIL but am getting confused about c# and MSIL integration. I understand that c# is compiled into MSIL before it is JIT'ed and then executed. I also understand that it is possible for me to generate my own MSIL using the System.Reflection.Emit namespace. However, is it possible for my c# code...
6
1998
by: Pawel | last post by:
Ary you know tools to convert MSIL code (Assembly) to Win32 (not Just In Time)?
7
2019
by: carl.manaster | last post by:
Hi, I'd like to take a string containing MSIL code, assemble it, execute it, and receive the result all from my running C# application. So far I've managed to manually create some MSIL code that I can successfully assemble with ilasm and execute at the DOS prompt, and I've read up on System.Reflection.Emit and CodeDom, but I don't see how...
3
3378
by: NigelW | last post by:
Clarification needed please. If I compile a C++ program with the /clr option inpsection of the resulting assembly with ILDASM shows MSIL even for methods in classes for which I have not specified garbage collection with __gc. Am I correct in thinking there is really two kinds of managed (i.e. MSIL) code from C++, that which uses garbage...
1
1805
by: John Doe | last post by:
Hi all, I have a lot of confusion about what this runtime environment is. When I write an application with unmanaged code and unmanaged data, can I compile it to the MSIL, or it will compile mandatorily to the x86 instruction set?
3
1643
by: Mark Fox | last post by:
Hello, I have read a lot about how the .NET Framework uses MSIL as its intermediate language. If I have a project in C# in VS.NET 2003, how do I get the MSIL for it so I could look at it? Better yet, I would like to obfuscate it using the Dotfuscator Community Edition and then get the obfuscated MSIL into a text file of some sort. How...
10
1910
by: Number 11950 - GPEMC! Replace number with 11950 | last post by:
Hi all, Playing VS2005 was more fun than Doom III, and I do enjoy my games. Anyway, it's back to work for me and I'm bogged down in my familiar VB6 stomping grounds because I don't want my secrets exposed to casual inspection via MSIL. VB6 doesn't do this to me, whereas, if I read Balena correctly, VB2005 always will. The one single and...
0
7512
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7951
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7803
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6036
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3495
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3475
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.