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: December 18, 2014 The Internet of Things (IoT) incorporates physical devices into business processes using predictive analytics. While it relies heavily on existing Internet technologies, it differs by including physical devices, specialized protocols, physical analytics, and a unique partner network. To capture the real business value of IoT, the industry must move beyond customized projects to general patterns and platforms. Check out this webcast and join industry experts as …

  • Learn How A Global Entertainment Company Saw a 448% ROI Every business today uses software to manage systems, deliver products, and empower employees to do their jobs. But software inevitably breaks, and when it does, businesses lose money -- in the form of dissatisfied customers, missed SLAs or lost productivity. PagerDuty, an operations performance platform, solves this problem by helping operations engineers and developers more effectively manage and resolve incidents across a company's global operations. …

Most Popular Programming Stories

More for Developers

RSS Feeds