Windows Phone 7 Development Tip: Use Concurrent Programming Techniques
Windows Phone 7 devices are out in the wild; now we can finally test if those emulator performance enhancements truly work. There is A LOT of misinformation out there about the hardware of the Windows Phone 7 devices. You can see that the Windows Phone 7 hardware utilizes the 1st generation SnapDragonprocessor which includes a single CPU. However, the single physical CPU is able to effectively manage multiple threads concurrently.
Today I had a chance to deploy a Windows Phone 7 sample from my book to a physical Windows Phone 7 device and I was pleasantly surprised that the multithreading performance in the emulator is reflected on the physical phone device. The sample I wrote was a simple slider that is tied to a fake activity of 150ms of CPU "work". On the physical device the second slider (shown below) completely locks up the entire device and the application becomes unusable. The third slider is very responsive, because it uses a secondary thread to manage the work.
I included the source code here. If you are interested in how this optimization works, refer to Chapter 10 (Concurrent Programming) and Chapter 12 (Mobile Intelligence) of my book. I have blogged numerous times about concurrent programming in Silverlight here, here and here. Even in my current book, I devoted an entire chapter to concurrent programming in Silverlight 4 including an example for the Windows Phone 7. Since Windows Phone 7 apps run Silverlight 3 (plus a little Silverlight 4 with some threading changes) all these multithreading techniques I have written about (in my book and online) will apply.