Even though we've been in the era of many-core processors for quite some time, not many developers bother to change their habits and try to use all that power. In fact many work for years without a single multi-threaded/asynchronous line of code written. A colleague of my wife was startled recently when she realized that she was supposed to write some asynchronous code yet she's been a developer for 3+ years now.
Fortunately Silverlight 2 is going to change all that. Due to the fact that Silverlight's UI runs on a single thread (just like all of the UI code on Microsoft platforms) and that most if not all network code does take time it would be unacceptable if the Silverlight plug-in would just block thus blocking the UI of the host (Web browser like Firefox, IE or Safari). Therefore the API designers decided to only use asynchronous model for each and every network related call.
Have a look at the WebClient or WebHttpRequest class and note there is no way to synchronously download a web page or any other content. While this is for sure going to confuse all those who ignored the asynchronous pattern in the .NET it is also going to force them to finally face it and use it.
I think this is a good thing. The asynchronous pattern in the .NET is very well done and deserves to be used more not just in Silverlight but with desktop applications too. There's no excuse today for a developer to create any application with a periodically unresponsive UI.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5