Edgenet Partners with Search Giant Bing

by Damon Payne 16. February 2011 15:48

Another press release for last year's big project!

http://www.edgenet.com/index.php/bing-webinar/bing-webinar.html

"We're proud to announce a new partnership with the search giant Bing. Bing highly values the quality and features of the data we provide, and we welcome their partnership as we continue to enhance your web presence."

Check it out.

Tags:

Silverlight | Technical Community

Upcoming Speaking Engagements

by Damon Payne 13. February 2011 19:38

Well, I didn’t get to speak at MIX 2011 as neither of my Open Call submissions got enough votes.  However, there are some most excellent closer-to-home venues I’ll be presenting at in the not to distant future:

Deeper in .NET 2011

http://www.wi-ineta.org/DesktopDefault.aspx?tabid=203

Well, it’s been a couple of years, but Milwaukee is going to have an awesome code camp again. This is going to be an awesome event with Mads Kristensen, Jay Schmelzer, Joe Stagner, Rocky Lhotka and.. me!  (Me?)How I get to take the stage next to giants like these guys remains a mystery but I have to thank the organizers for making room for a home-town presenter. 

 

Fox Valley Day of .NET

http://dayofdotnet.fvnug.org/

I think this will be my third year in a row speaking at this event.  Wow am I getting old.  The guys in the Fox Valley have really created a fantastic community up there.  The Fox Valley guys are cutting edge, busy, and bigger than most people down in the Metro Milwaukee area realize.  Not only is this a great event every year but they take great care of the speakers.  <Beer/>  I'm definitely looking forward to this event. 

It’s too bad that, at this event, I’m going to have to make some tough decisions.  My compatriots from the Madison area, Lance Larsen and Travis Feirtag, are both giving great talks at the same time.  I can’t see Scott Seely’s talk because he’s in the same slot as me.  Maybe we can get the guys to record the sessions this year?

Tags:

Silverlight | Technical Community | Architecture and Design

Binary Drop For the Task Parallel Library for Silverlight

by Damon Payne 13. February 2011 18:45

Since there was interest, I am doing a binary drop of my port of the Task Parallel Library for Silverlight 4.  Please contact me with feedback, bugs, and suggestions.  Once I’m done with some more performance–centric unit tests I will post the source code as well.  I’d like to have something set up that shows this off within a Silverlight app.

Download the binaries here.

Tags:

Silverlight | Parallel

Task Parallel Library Ported to Silverlight 4

by Damon Payne 7. February 2011 19:02

Long time readers will recall that I’ve done some oddball parallel articles over the years.  I recently decided to challenge myself with porting the Task Parallel Library to Silverlight 4.  The port is complete and all unit tests pass.  I’m still profiling but I’m generally encouraged by the results.

Why?

A fair question.  Why do I need libraries for making it easier to write multithreaded code in Silverlight? 

First, Silverlight is making big strides as a platform for Business applications.   Business applications might be able to absorb extra computing power on the client machine.  I envision data analysis applications doing lots of work on the client PC.  Silverlight Games might be another case when you are doing a lot of game-world updating or computations yourself.  What about popular distributed computing applications like Folding @Home or SETI? 

Then, of course, there’s the fact that we find ourselves doing minor threading work on Silverlight applications already today.  For example, at work I have a Silverlight application which imports data from very large Excel files on background threads.  The fact is that the Task model, the Cancellation Token model, and the Concurrent Data Structures are just really nice programming models.

Comments on the TPL Port, and Porting in General

I didn’t start from scratch.  The Mono Project has been working on an implementation for their .NET 4 stack.  Most of the credit, then, goes to Jérémie "Garuma" Laval.  I grabbed all of System, System.Collections.Concurrent, System.Collections.Concurrent.Partitioners, System.Threading, and System.Threading.Tasks and brought things in one class at a time as I needed them to get System.Threading.Tasks to compile.

Some comments on the port:

  • Serializable –  A good example of something that’s missing from Silverlight.  I find that I tend not to comment these things out but rather make an attribute that does nothing.  If Silverlight supports this in the future or I discover something useful I could do the mock version is nice.
  • No Thread.Yield in Silverlight – I was worried things like this being missing would kill this port.  After doing some research, replacing these with Thread.Sleep(0) should have the desired effect.
  • No Interlocked.Read in Silverlight – I’m most worried by this omission.  Interlocked.Read allows you to do atomic operations on long integers in a 32bit process, which Silverlight always is until Silverlight 5.  I don’t have pointers or any other workarounds that I could think of either.  This means in the work-stealing portions of the Queues that parallel tasks use I have some operations that need to be atomic but aren’t.   I may go back and change these to 32bit integers.  No one wants to wait on a long integer’s worth of Tasks anyway. 
  •  No Thread priority in SIlverlight- The task parallel library portions that dealt with thread priority had to be #-defined out.
  • Array.Convert() – Missing from Silverlight, but easy to re-create as an extension method.

Performance and Source Code

I am doing some profiling to see if there’s anything I can do to increase performance.  Running the same unit tests on this port and the full .NET framework has revealed that this code isn’t as fast on Silverlight.  Still, as I said I think having this programming model is pretty nice even without perfectly linear per-core speedups. 

I will release the source code if there’s interest.  I believe the Mono license allows me to do this as long as I leave their license in tact in the the source files.  I should definitely head out to user voice and ask for some of these features in a future version of Silverlight.

Tags:

Silverlight | Parallel

About the author

Damon Payne is a Microsoft MVP specializing in Smart Client solution architecture. 

INETA Community Speakers Program

Month List

Page List

flickr photostream