Monday, June 23, 2008
« Blogged.com rating | Main | Not for profit? Morally Bankrupt! »

Dan has an article showing some nice syntactical sugar for spawning threads.  Dan has been studying the model of CCR, currently part of Robotics Studio.  The article specifically mentions the Compact Framework, but if you are doing full-framework development I would encourage you to check out the Parallel Extensions library as well.  It was mentioned at TechEd that the CCR might be refactored to use the TPL, so it'd be worth taking a peak at.  Using System.Threading.Tasks you could write code that starts to look less like the traditional ThreadStart code and more like what Dan is doing.  Without spending more than 30 seconds on this idea:

TaskCreationOptions tco = TaskCreationOptions.Detached;

TaskManagerPolicy tmp =

new TaskManagerPolicy(1, Environment.ProcessorCount,1,0, System.Threading.ThreadPriority.AboveNormal);

TaskManager tm = new TaskManager(tmp);

Task t = Task.Create(

(a) => { Console.WriteLine("doing some work"); },

tm, tco);

If we start to see some multi-core mobile processors, it might be an interesting excercise to port a subset of PFX to the Compact Framework.

Monday, June 23, 2008 7:53:53 PM (Central Standard Time, UTC-06:00)
If they do use PFX to implement the details of CCR, I imagine they'll make PFX CF friendly. Otherwise CCR will lose its ability to run on mobile devices, and that would make too many people upset. :) We need _universal_ primitives for concurrency and coordination, not primitives that will only be understood on certain device types or platforms.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview