Recursion and Concurrency

When teaching recursion in an introductory computer science course, one of the most common examples used involves a tree data structure.  Trees are useful in this regard as they are simple and recursive in nature, with a tree’s children also being trees, and allow for teaching different kinds of traversals (in-order, pre-order, post-order, level-order, and so… Read more

Parallel Aggregations in PLINQ

Quick Overview of LINQ Aggregations In order to explain the issues we encounter when parallelizing aggregations in PLINQ, let’s first take a quick look at how aggregations work in LINQ. Aggregation is an operation that iterates over a sequence of input elements, maintaining an accumulator that contains the intermediate result. At each step, a reduction… Read more

Debugger display of PLINQ queries

Sometimes very simple additions to an API or implementation make me happy.  One such nicety in the CTP of PLINQ is the implementation of ToString on the concrete types that represent query operators.  These implementations provide a textual representation of the query structure, which can be very nice for debugging purposes. Consider the following LINQ query,… Read more