C# Parralelism Remember this Crap

Apr 04, 2011 15:37

Originally published at The Jux Entente. You can comment here or at our Forum.
I’m posting this here so that I can NEVER FORGET:

(4:33:35 PM) Peter Rosconi: Holyyyyyy shit
(4:33:43 PM) Peter Rosconi: C# parralelism is the shit
(4:34:31 PM) Graeme Hefner: Explain
(4:34:43 PM) Peter Rosconi: List actions = new List();
actions.Add(() => LoadIdentificationTexts());
actions.Add(() => LoadAssociations());
actions.AsParallel().ForAll(a => a.Invoke());
(4:34:57 PM) Graeme Hefner: …wait, seriously, it just runs them all?
(4:35:00 PM) Graeme Hefner: In parallel?
(4:35:03 PM) Peter Rosconi: Yup
(4:35:09 PM) Graeme Hefner: That is the most badass goddamn thing I have ever seen.

news

Previous post Next post
Up