Parallel goodness
I think I pretty much arrived to the point where my work is starting to get useful. With yesterday basic Tasks implementation and today Parallel.For work I was able to run a parallelized version of Luke's C# RayTracer. There was already a version using ParallelFx in the CTP samples but I preferred to made my custom, simpler one :
After some micro-benchmarking on my dual-core system the overall speed improvement is around 42%. Deductively it should be 50% but due to the work-stealing algorithm overhead it's a little less. Still it's a good improvement over the classic and synchronous version.
Like the folks at the ParallelFx blog did I added some color mask to show which thread was doing the work :
As we can see the work is almost homogeneous between each of the processor. The small delta is explained by the fact that while one of the thread is in the middle of queuing all the work, the other is already processing it.
The code for the parallel ray tracer is here : http://monoport.com/25053. If you want to test it out grab a copy of the source from here in addition (warning : it's probably full of bugs and won't work on your system ;) ). Run the program with --thread-mask
for the color mask.