I'm just getting started with TBB, and am having problems trying to model something in this framework. Suppose I have an input sequence of data items consisting of a mixture of fruit, e.g. apples, pears and oranges. The processing I need to do on each of these fruit depends on the kind of fruit. Furthermore, I'd like to batch up the fruit into "boxes", each containing just one kind of fruit, so that I only process a box at a time. Without TBB I'd write a thread that read in the fruit one at a time, sorted them into buckets based on their type, and parceled them up into boxes.