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.


Silverlight | Parallel

Comments (4) -

Nadav Israel
2/15/2011 12:59:07 AM #

I Damon,

Thanks for providing the binary drop.
I've been testing it and there are two problems I've found:
The small one is that there are some functions missing, like TaskFactory.StartNew()
But the real problem is that the scheduler returned from TaskScheduler.FromCurrentSynchronizationContext() does not work as it should.
            new Task(() => label1.Content="test").Start(TaskScheduler.FromCurrentSynchronizationContext());
throws an invalid cross thread access exception.

Anyway, thanks for the dlls.



Damon Payne
Damon Payne United States
2/16/2011 3:48:43 PM #

Nadav, thank you, I am going to be out of the country for a while but I will try to address these issues.


Nadav Israel
2/17/2011 12:58:44 AM #

I think I found another problem:

When calling ContinueWith on the thread that has already completed we get this exception:

System.InvalidOperationException: The event is already set
   at System.Threading.CountdownEvent.AddCount(Int32 signalCount)
   at System.Threading.CountdownEvent.AddCount()
   at System.Threading.Tasks.Task.AddChild()
   at System.Threading.Tasks.Task..ctor(Action`1 action, Object state, CancellationToken cancellationToken, TaskCreationOptions creationOptions, Task parent)
   at System.Threading.Tasks.Task`1..ctor(Func`2 function, Object state, CancellationToken cancellationToken, TaskCreationOptions creationOptions, Task parent)
   at System.Threading.Tasks.Task.ContinueWith[TResult](Func`2 continuationFunction, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler)
   at System.Threading.Tasks.Task.ContinueWith[TResult](Func`2 continuationFunction, TaskContinuationOptions continuationOptions)
   at SilverLightClient.TaskExtensions.OnGuiThread[T1,T2](T1 task, Func`2 action, TaskContinuationOptions options)


Fallon United States
2/28/2011 3:47:14 PM #

Thanks for the drop.

As soon as I get some bandwidth(time), I'll be able to test.


Pingbacks and trackbacks (3)+

Add comment

  Country flag
  • Comment
  • Preview

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