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

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Mobile devices, social business apps, and business analytics are converging with the Cloud to create the most substantial changes in technology since the Internet revolution. Businesses have to change the way they think and operate, and with rising budgets for technology, they need someone to provide the services that will keep them competitive in this environment. Learn more about the important technology trends you need to stay on top of to ensure your business doesn't get left behind.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds