Disclosed are, inter alia, methods, apparatus, data structures,
computer-readable media, and mechanisms, for matching items with
resources, such as, but not limited to packet processing contexts, output
links, memory, storage, specialized hardware or software, compute cycles,
or any other entity. One implementation includes means for maintaining
distribution groups of items, means for maintaining differently aged
resources queues, and means for matching resources identified as being at
the head of the plurality of differently aged resources queues and as
being primarily and secondarily associated with said distribution groups
based on a set of predetermined criteria. For example, even though
processing contexts can be shared among different distribution groups of
packets, by giving preference to assigning recently used processing
contexts for processing packets of a same distribution group, it is more
likely that the processing instructions are already in the memory of this
processing context, and therefore, processing will not be delayed until
such instructions are retrieved into memory.