Warning: Silverlight does not support Asynchronous Delegates verywell (unlike WPF)

R

RayLopez99

Going through some examples in Chap. 19 of Albahari's excellent C#
book on Threading, and the section on Asynchronous Delegates. I
notice WPF handles them well, whereas Silverlight (version 3.0)
chokes. Just a heads up.

RL

MyDelegate del = new MyDelegate(myClass1.MyMethod);
IAsyncResult async = del.BeginInvoke

If you do not already know, Silverlight supports distributing logic up
to eight processor cores (This frustrates me that Microsoft doesn't
adverstise this enough). In my opinion, concurrent programming is THE
biggest feature of Silverlight over other RIA technologies (i.e.,
Flash, JavaFX). However, implementing asynchronous patterns in
Silverlight is not trivial. The callback pattern is messy and leads
to a lot of code. Silverlight runs in an STA mode and requires UI
elements to only be modified by the main thread (dispatching or
synchronization). Even asynchronous constructs like the
BackgroundWorker that are supposed to make concurrent programming
simple lead to many messy lines of code with events. Wouldn't it be
great to get the benefit of asynchronous programming without having to
write many lines of additional code?
 
Top