Re: What is 'managed code'?



Wow, that was the answer of the year, Michael.
Thanks a lot.
I am TAPI developer using vb5.
It is not the easy job, specially that I need to adapt C routines into vb
compatible code.
Jack


"Michael D. Ober" <obermd.@.alum.mit.edu.nospam> wrote in message
news:ormSe.5683$Wd7.3054@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Very simply, managed code is code that the runtime system handles all
> aspects of memory and resource management. The managed code model is that
> of infinite resources. But since we know that resources on any given
> system
> are finite, the runtime must do a lot of work to present this model. To
> do
> this requires that the runtime system present a garbage collector that can
> sweep through the application memory and find all unreferenced resources,
> be
> they memory, IO Ports, files, etc., and properly close and release them
> back
> to the OS. In the case of memory, the garbage collector must also compact
> available memory to consolidate free space for further allocations.
>
> VB 5&6 almost do this for memory only, and then only if you don't use
> direct
> Windows API calls. When using ActiveX components, which are all COM
> Objects, the Component Object Module runtime DLLs perform a simple
> reference
> counting. When an ActiveX component's references go to zero, the COM
> runtime releases the memory of the COM Object. Note that the COM runtimes
> don't close files or other resources - they belong to the process and the
> OS
> will close them when the process exits. In VB 5&6, memory references are
> also reference counted, which means that it is possible to create two
> objects that reference each other, yet are impossible to reference from
> the
> application. The VB 5&6 Garbage Collector will never free these objects.
> Nor can the VB 5&6 Garbage Collector consolidate free memory space.
> Neither
> of these weaknesses of a reference counted memory scheme are usually a
> problem.
>
> Now to the kicker - VB 5&6 are a very sophisticated implementation of a
> COM
> object, to the extent that each form is a COM Object. This is why you
> need
> to be careful when referencing controls on a form during your Form_Unload
> event procedures. Doing so creates a new reference to the form, which
> prevents the form from being reclaimed by the COM runtime.
>
> The major weakness of fully managed code is that it is significantly
> slower
> than unmanaged code. The TAPI API is a near real-time API. Real-time and
> Managed cannot be used in the same sentence. Other common Windows APIs
> that
> fall into this category include the Multimedia API and DirectX. VB 5&6
> are
> partially managed and as such, tend to lie between fully managed code and
> unmanaged code in performance. Runtime resource management of any type
> incurs a performance penalty, regardless of language.
>
> To those of you who think this is a .NET question - it's not. This is a
> question of language design and implementation. In the Microsoft world,
> .NET is fully managed, FoxPro and VB 5&6 are partially managed, and C/C++
> (including the ATL and MFC extensions) is unmanaged. JAVA, APL,
> Smalltalk,
> and Lisp are also fully managed. You can tell unmanaged languages by the
> presence of explicit pointers to memory. Managed code generally doesn't
> support explicit pointers except where required for call backs and event
> handlers.
>
> Mike Ober.
>
>
> "Jack" <replyto@newsgroup> wrote in message
> news:uLY4xBEsFHA.3720@xxxxxxxxxxxxxxxxxxxxxxx
>> From MSN:
>> This article discusses why Telephony Application Programming Interface
>> (TAPI) is not supported from managed code.
>>
>> What is that managed code?
>>
>>
>
>


.



Relevant Pages

  • Re: What is managed code?
    ... managed code is code that the runtime system handles all ... aspects of memory and resource management. ... But since we know that resources on any given system ... the Component Object Module runtime DLLs perform a simple reference ...
    (microsoft.public.vb.general.discussion)
  • Re: Public Variable: Explain Please
    ... Unless you've kept a variable around with a reference to ... The object is still holding on to resources and memory. ... The only way to release all memory and resources is to unload the form ...
    (comp.lang.basic.visual.misc)
  • Passing a pointer to long
    ... I have a function written in C++ that allocates a certain amount of memory, ... My first question is how to do the marshalling and pass the reference ... My second question is if it is possbile for the managed code to free the ...
    (microsoft.public.dotnet.framework.interop)
  • Re: GC and dispose
    ... Let's imagine an ObjectB that has a reference to ObjectA because ObjectA was previously hooked to an event in ObjectB. ... Dispose is for making sure resources that are not simply managed heap allocations get cleaned up. ... Unmanaged resources such as handles or Win32 memory allocations are fine examples of such, but there are certainly managed examples as well. ...
    (microsoft.public.dotnet.framework)
  • [RFC] page replacement requirements
    ... Submitting too much I/O at once can kill latency and even lead to deadlocks when bounce buffers are involved. ... Must be able to deal with multiple memory zones efficiently. ... When on completion of the write to their backing-store the reference bit is still unset a callback is invoked to place them so that they are immediate candidates for reclaim again. ... For traditional page replacement algorithms this is not a big issue since we just implement per zone page replacement; ...
    (Linux-Kernel)

Loading