- Three commandments of Multi-Threading: 1. Thou shall not block the UI thread, 2. Thou shall not access objects on a non -UI thread. , 3. Thou shall not access variables on multi-threads without protection (locks).
- The instructor, Brian Noyles, went over different patterns for Ansyc processing:
- Begin/End pattern, which is the most powerful but also the most complex. he didn't recommend using this for UI stuff.
- Async/Completed pattern. This is the one we currently use in our Silverlight app. This was the most familiar to me.
- TPL: Task Parallel Library. Only .NET 4 and not for SL (yet).
- Parallel Framework (PFX) and PLINQ. There are Parallel.For and ForEach commands, and PLINQ is a LINQ statement that runs on multiple threads, var q = from item in data.AsParallel() select item +1
- Task Based Ansyc Pattern (TAP). He stated that "tasks" are the future. This is only available as a CTP but will be released in the next version of .NET. This adds new keywords to the languages (VB and C#). It allows you to write Synchronous looking code which actually compiles down to be Async. Two of the new keywords are: Async and Await.
- Reactive Extenstions (Rx): Like LINQ for Events. Allows you to write LINQ against some evnents, kind of hard to follow his demo. He said is available now.
Tuesday, May 17, 2011
Async Calls in Silverlight and WPF
This was very fast paced for such a complex subject. Here are the highlights:
Subscribe to:
Post Comments (Atom)
Sounds interesting... How does this topic mesh with the recent ProjectTrack change? Is this the Async/Completed pattern? Anything that we would do differently? How do you know if you even need to use any of these patterns?
ReplyDelete