Sunday, July 8, 2012

Difference between Managed code and Native code

Native Code: Native code is computer programming (code) which generally written in C, C++ language and after compilation its IL is specific to the Processor Architecture. With respect to .net programming, Native code is the code is not managed code. The code takes care of allocation and de-allocation of every bit of memory to object. There is no garbage collection, reference counting kind of memory management for the Native code. For example C++ code. C++ code is not a managed code. To dereference the unused object we have to explicitly call Delete. There is no Garbage collector for C++ code. Unfortunately, I haven’t work on C++ language.

Managed Code: Managed code is executed by .Net Framework Common Language Runtime (CLR). It refers the contract of co-operation between natively executing code and the run-time. The memory allocation and de-allocation to an object is done by .Net Framework. User doesn’t have control on it. Dereferencing the unused memory/object has been taken care by Garbage Collector (GC).  Example: we use Finalize() and Dispose() method in our Managed Code implementation.  Garbage Collection runs Finalize() method before an object that is eligible for collection is reclaimed. Dispose() cleans unmanaged resources, like network connections, files etc.

Cheers!

1 comment:

  1. Difference Between Managed Code And Native Code >>>>> Download Now

    >>>>> Download Full

    Difference Between Managed Code And Native Code >>>>> Download LINK

    >>>>> Download Now

    Difference Between Managed Code And Native Code >>>>> Download Full

    >>>>> Download LINK dz

    ReplyDelete