Top 6 Common Language Runtime Features in Windows Phone 8

Introduction

Windows Phone 8 introduces some very hot features from Common Language Runtime that provide tremendous benefits to Windows Phone application developers.

Here is the list of top 6 Common Language Runtime features that were introduced in Windows Phone 8.

1. Faster Code Generation

Windows Phone 8 has enabled optimization for code generation by the Just-In-Time compiler. This allows for improving the application performance. By having application files precompiled to native in the cloud, Windows Phone store guarantees best performance of a Windows Phone 8 application.

2. Threading

The .NET framework engine behind Windows Phone 8 is multi-core aware and supports the ThreadPool class. This support allows applications to create threads.

Additionally, the task parallel library offers Windows Phone 8 application all thread synchronization primitives to leverage multiple cores.

Note that Thread.Sleep in Windows Phone 8 does not perform standard COM and SendMessage pumping. Calling Thread.Sleep in Windows Phone 8 will make the application unresponsive, blocking DispatcherTime and BackgroundWorker events.

The performance of async and parallel operations that use classes, which reside in System.Threading.Tasks namespace has been improved in Windows Phone 8.

3. Security Model

The security model in Windows Phone 8 has changed compared to Windows Phone 7.1. There is no managed sandbox (which has been removed in Windows Phone 8), resulting in security exceptions like MethodAccessException not to be thrown in typical cases.

4. Garbage Collection

GC (Garbage Collection) in Windows Phone matches Silverlight. (There are three generations in Windows Phone 8, unlike Windows Phone 7.1, which had only 2 generations).

The resource manager for the phone automatically invokes Garbage Collection when memory is short, and it can additionally terminate the application if it exceeds the memory cap.

The garbage collector in Windows Phone 8 includes a large object heap (LOH), however, background garbage collection is no longer offered in WP8.

5. Portable Class Libraries

With Portable class libraries, application developers can write class libraries that they can share across modern applications on Windows 8 as well as mobile applications on Windows Phone 8. This is supported by the Portable Class Library project template in Visual Studio 2012.

A Portable Class Library that is targeted for Windows Phone  7.1 and Windows Phone 8 can be run on Windows Phone 8 without any issues.

6. Interop

Windows Phone 8 applications can directly invoke Windows Runtime APIs from managed code, reducing memory and other interop issues.

Summary

In this article, we learned about new common language runtime features that we released as part of Windows Phone 8. I hope you have found this information useful.

About the Author

Vipul Patel is a Program Manager currently working at Amazon Corporation. He has formerly worked at Microsoft in the Lync team and in the .NET team (in the Base Class libraries and the Debugging and Profiling team). He can be reached at vipul.patel@hotmail.com



Related Articles

Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • On-demand Event Event Date: September 10, 2014 Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild." This loop of continuous delivery and continuous feedback is how the best mobile …

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds