I've got a number of objects. I need to deal with each pair concurrently (not every pair, arbitrary pairings), but each object should be only dealt with in serial.
I'm struggling to describe an algorithm which can deal with this, preferably without involving a bunch of locks. I've got the PPL from Microsoft, so I have some fairly high-level concurrency functions at my disposal.
Finally, a lot of the time I'll be dealing with very few pairings per object- with zero and one especially common. But many-many pairings are a boundary condition I do have to deal with.
Any suggestions for such an algorithm?