Patent ID: 7856510

Claim:
A method performed in a network device, comprising: first processing, by a processor of the network device, of first data to generate routing information for a first key; determining, by one or more devices of the network device, that the processor is going to be requesting first information, related to the first data, to continue the first processing, where based on the determination: instructing, by the processor, one or more devices of the network device to store a first partial processing result and first context state information, for the first data, generated by the first processing, requesting, by the processor, the first information, and initiating, by the processor, second processing of second data to generate routing information for a second key; determining, by the one or more devices of the network device, that the requested first information is received at the processor, or that the processor is going to be requesting second information, related to the second data, to continue the second processing, where based on the determination: instructing, by the one or more devices of the network device, the processor to store a second partial processing result and second context state information, for the second data, generated by the second processing, requesting, by the processor, the second information, and resuming, by the processor, the first processing of the first data using the received first information and the first partial processing result and the stored first context state information; receiving the requested first information from a memory associated with the network device, wherein the first processing and the second processing are performed concurrently; and determining a number of the first data and the second data to be processed concurrently based on a ratio of a latency of the memory to an average time for processing one of the first data and the second data.