Funny parallelism
For those who have some free leisure time this weekend and would like to explore a bit ParallelFx in a didactic manner I ported to Linux a Sudoku game coming from ParallelFx CTP samples which optionally uses ParallelFx to generate Sudoku grids.
For screenshot fans that’s how it looks like :
You can enable the use of ParallelFx via the two options “Use multiple processors to generate puzzles” and “Use speculative puzzle generation” found in the Game settings box :
The first one uses Parallel.For instead of a standard for to generate grids and the other allows the background generation of further grids using Future.





Does that really need to be an option?
Who would stroke their fledgling chin stubble and say to themselves, “Hm, I DO have a multicore processor, but I DON’T want the speed benefit… or DO I?”
> Does that really need to be an option?
For a real application probably not, but here it’s a test application. If you look at console output you will see time spent to generate a puzzle which of course depends on these options being enabled or not, isn’t it nice to see the actual improvement your multicore CPU gives you ?
Sudoku solver in LINQ I ported from Python/JavaScript2:
http://aspadvice.com/blogs/rbirkby/archive/2007/08/23/Silverlight-Sudoku-with-LINQ.aspx
You can see the code here:
http://aspadvice.com/blogs/rbirkby/attachment/34077.ashx
It runs so fast I doubt there’s any point parallelizing it.
It may not be the best illustration of parallelism (though expert-level grid do take time to generate), but again, as the title and post imply, it’s just to show something different than the usual benchmarks and graphic stuff, something more interactive and which makes practical use of ParallelFx’s API.