2 ms·
I'm really exited about the new concurrency libraries, things like Parallel LINQ and the Task Parallel Library. To think that you can write code such as: vo
by dschobel 17y ago
I'm really exited about the new concurrency libraries, things like Parallel LINQ and the Task Parallel Library.
To think that you can write code such as:
void Render(Scene scene, Color[,] rgb)
{
Parallel.For(0, screenHeight, y =>
{
for (int x = 0; x < screenWidth; x++) {
rgb[x,y] = TraceRay(new Ray(scene,x,y));
}
});
}
and
var q = src.AsParallel()
.Where(x => ExpensiveFilter(x));
foreach(var x in q) { ... }
just has to make you grin from ear to ear.