Difference between managed and unmanaged
code
What is Managed Code ?
Managed code is the code that is written to target the services of
the managed runtime execution environment such as Common Language Runtime in
.Net Technology.
The Managed Code running under a Common Language Runtime cannot be
accessed outside the runtime environment as well as cannot call directly from
outside the runtime environment. It refers to a contract of cooperation between
natively executing code and the runtime. It offers services like garbage
collection, run-time type checking, reference checking etc. By using managed
code you can avoid many typical programming mistakes that lead to security
holes and unstable applications, also, many unproductive programming tasks are automatically
taken care of, such as type safety checking, memory management, destruction of
unused Objects etc.
What is Unmanaged Code ?
Unmanaged code compiles straight to machine code and directly
executed by the Operating System. The generated code runs natively on the host
processor and the processor directly executes the code generated by the
compiler. It is always compiled to target a specific architecture and will only
run on the intended platform. So, if you want to run the same code on different
architecture then you will have to recompile the code using that particular
architecture.
No comments:
Post a Comment