Sunday, October 18, 2015

Managed Vs Unmanaged Code

Managed Code: Code written in any .net language run under CLR environment is managed code.

CLR provides it's services to manged code
  1. Garbage Collection
  2. Error Handling
  3. CTS (Common Type System)
  4. CAS (Code Access Security)
  5. Code Verification 
  6. Performance Improvement: Decides which JIT to use & assigns to JIT. JIT compiles IL to native m\c code.
Unmanaged Code: Code that does not target CLR environment for execution is UnManaged code.

Language Compilers checks below items at compile time but these are again rechecked at runtime by CLR because 
MSIL can be modified by external tools like ILDASM or ILASM.

  1. Types 
  2. Stack usage 
  3. Method calls 
  4. Memory safety 
  5. Control flow 

No comments:

Post a Comment

Node | Cluster Vs Worker Threads

Cluster: Multiple processes (scale app across CPU cores) Worker Threads: Multiple threads (handle CPU-heavy work inside one process) Cluster...