computer science - managed code vs unmanaged code -


i'm trying mind wrapped around concept of managed vs unmanaged code. correct me if i'm wrong managed code gets compiled down bytecode while unmanaged code gets compiled down machine code.

is correct?

from annakata's answer:

managed code not compiled machine code intermediate language interpreted , executed service on machine , therefore operating within (hopefully!) secure framework handles dangerous things memory , threads you. in modern usage means .net not have to.

unmanaged code compiled machine code , therefore executed os directly. therefore has ability damaging/powerful things managed code not. how used work, typically it's associated old stuff .dlls

now, what's going on under hood? managed vs unmanaged all memory.

in managed code, code doesn't directly manipulate memory. gives instructions runtime on code's behalf. way, unsafe or illegal operations can blocked, , code operates in semi-sandbox. managed languages can , have unmanaged code - such nature of computing.

visualize memory giant parking lot. difference between managed , unmanaged language this:

in managed language, walk valet , explain want 10 cars parked. don't know where they're parked, know valet gladly retrieve them time want. don't decide they're parked - tell valet need parked.

in unmanaged language, it's job pick spots. drive other cars, park in handicapped spots, whatever- gives better performance (you don't have relay instructions valet) but can make lot of stupid/dangerous mistakes.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -