Patent attributes
A method of forwarding packets in a network device is disclosed. The method comprises assigning a packet to a first packet processing thread; and determining a state of the first packet processing thread. Responsive to determining that the state of the first packet processing thread is a backlogged state, mapping the packet to a second packet processing thread from a pool of packet processing threads based on a load balancing scheme, wherein the pool of packet processing threads includes a subset of threads from the plurality of packet processing threads, and the state of each one of the packet processing threads from the pool is the backlogged state, processing the packet in the second packet processing thread, and forwarding the packet according to a predetermined order that is based on a position of the packet relative to positions of other packets at their receipt in the network device.