Compact 2013 Ebook

13.3 Managed Code Apps
Created by djones on 6/18/2013 1:22:37 AM

Managed Code Applications

Managed code is code that has its execution managed by the .NET Framework Common Language Runtime. In a Windows environment, Managed Code is the alternative to Native Code. Managed code compilers generate virtual machine code and so applications developed in managed code will run on any system that implements the virtual CPU that interprets those instructions. The instruction set for this virtual processor is called Microsoft Intermediate Language (MSIL) which is generated by Managed Code compilers. In this way, managed code is interoperable across different systems and across programming languages. When such an application runs, the intermediate code is either interpreted in real-time by the runtime or converted into machine code on-the-fly and run. The Microsoft implementation uses Just –In-Time compilation (JIT) which compiles MSIL code into native code whenever a method is first called by an application. Another key aspect of Managed Code is Garbage Collection where the OS keeps track memory resources of objects and at some stage after the objects loose context, the garbage collector recovers the memory resources. .NET also provide the implementation of a rich set of proven high level libraries facilitating the simpler implementation of complex applications. Finally, Managed Code development facilitates Rapid Application Development (RAD) through features such as Visual User Interface Development and Intellisense.

clip_image002

Figure 13.1: .NET CF Architecture

clip_image004

Figure 13.2: .NET CF code generation and use

Compact 2013 uses a smaller version of the .NET runtime called the .NET Compact Framework. It uses version 3.9 of the Compact Framework which is close to that used by Windows Phone 7, leading to performance improvements optimized on the phone platform. The Compact Framework has C# and Visual Basic compilers. There is no C++ Compact Framework compilers, unlike with the full Framework. Because of the restricted environment of Windows Embedded Compact, the Compact Framework Garbage Collector has always used a different algorithm to the desktop one, being more aggressive in recovering resources. Compact 2013 introduces the Generational GC. CF3.9 is multicore safe whereas the previous version of the Compact Framework fudged this by forcing all Managed Code to run single threaded. Finally, Floating Point .NET computations are now done by the CPU Maths Coprocessor where available instead of in libraries. Whilst the desktop .NET has a tool called ngen for pre-JIT-ing MSIL code, that is not available with the Compact Framework. Other features not available with the Compact Framework are .NET Remoting, ASP.NET (server end), aspect of .NET Reflection and some limitations with .NET Security.

A performance improvement with .Net CF 3.9 is that JITed code is shared across applications. That is, once a MSIL method has been converted to machine code by one application, all applications can use the same JITed code without recompiling it.

The .NET CF library, besides being a subset of the full Framework, used to have some extra classes that were specific to mobile and embedded devices. At this stage .NET CF no longer supports the CE SQL (or SQL Compact) library. Also the Infrared Library is no longer supported. Finally, you can’t do mixed mode debugging with the Compact Framework: With an application that uses both Managed and Native, you can only debug the Native or the Managed code, not both at the same time.


NEXT: Native Code v Managed Code

print

Click here to provide feedback and input

  Comments

There is no comment.

Turkish porno izle video site in rokettubeporno izle