Editorials

Application Responsiveness

Application Responsiveness

In the Microsoft world, application responsiveness had always required a lot of effort until the later releases of the Dot Net Framework. A good example of application responsiveness would be the ability to click on a button in a form and have that fire off an action while still handling actions against that form. In other words, the activity that was instantiated does not disable any other process from the form until the activity completed.

Responsive applications required a lot of extra effort because in order to do that you had to use a different thread for your actions in order to keep your user interface thread responsive. Threads required some work on your part, and you needed to understand different synchronization concepts amongst other things to keep everything working smoothly. In fact, you could no longer count on the order in which code was executed if it was on different threads.

Microsoft has taken an approach in their latest operating system requiring different threads be used so that your application is always responsive. In their tablet and phone products this requirement makes a lot of sense. You don’t want an application freezing up the device while it is performing some background process.

Microsoft didn’t just make these requirements without providing developers with tools to implement this requirement in a powerful way. They have created new techniques for firing off other work, synchronizing the notification when work is completed, and providing objects that are multi-thread safe, assuring accurate concurrent usage.

If you aren’t moving toward multi-thread development in Dot Net now you will probably have to very soon. Responsiveness is not the only reason; performance will be important too as we continue to expand processers by adding multiple cores.

I you would like to get an introduction to some of the techniques simplifying multi-threaded applications I find the Demystifying .Net 4.5 Async presentation by Mitchel Sellers to be a pretty good introduction.

Are you finding .Net threading to be daunting? Do you like the new constructs in .Net for threading and synchronization? Share your comments here online, or drop me an Email at btaylor@sswug.org.

Cheers,

Ben