A method of forwarding packets in a network device, the method comprising: receiving a packet at the network device; assigning the packet to a first packet processing thread from a plurality of packet processing threads, wherein each one of the plurality of packet processing threads belongs to one of at least a normal pool of packet processing threads and a backlogged pool of packet processing threads; determining a state of the first packet processing thread, wherein the state was set based on a monitoring of a length of a queue of the first packet processing thread, and wherein the state is determined to be one of a plurality of states including a backlogged state and a normal state, and the state indicates to which pool of packet processing threads the first packet processing thread belongs, and wherein determining the state to be the backlogged state comprises determining that the length of the queue or an exponentially weighted moving average, EWMA, of the length of the queue is above a predetermined threshold; responsive to determining that the state of the first packet processing thread is a normal state, performing the following: mapping the packet to the first packet processing thread, processing the packet in the first packet processing thread, and forwarding the packet; and responsive to determining that the state of the first packet processing thread is a backlogged state, performing the following: mapping the packet to a second packet processing thread from the backlogged pool of packet processing threads based on a load balancing scheme, wherein the backlogged pool of packet processing threads includes the first packet processing thread and a subset of packet processing threads from the plurality of packet processing threads, and the state of each one of the packet processing threads from the backlogged pool is the backlogged state, processing the packet in the second packet processing thread, and forwarding the packet according to a predetermined order, wherein the predetermined order is based on a position of the packet relative to positions of other packets at their receipt in the network device. receiving a packet at the network device; assigning the packet to a first packet processing thread from a plurality of packet processing threads, wherein each one of the plurality of packet processing threads belongs to one of at least a normal pool of packet processing threads and a backlogged pool of packet processing threads; determining a state of the first packet processing thread, wherein the state was set based on a monitoring of a length of a queue of the first packet processing thread, and wherein the state is determined to be one of a plurality of states including a backlogged state and a normal state, and the state indicates to which pool of packet processing threads the first packet processing thread belongs, and wherein determining the state to be the backlogged state comprises determining that the length of the queue or an exponentially weighted moving average, EWMA, of the length of the queue is above a predetermined threshold; responsive to determining that the state of the first packet processing thread is a normal state, performing the following: mapping the packet to the first packet processing thread, processing the packet in the first packet processing thread, and forwarding the packet; and mapping the packet to the first packet processing thread, processing the packet in the first packet processing thread, and forwarding the packet; and responsive to determining that the state of the first packet processing thread is a backlogged state, performing the following: mapping the packet to a second packet processing thread from the backlogged pool of packet processing threads based on a load balancing scheme, wherein the backlogged pool of packet processing threads includes the first packet processing thread and a subset of packet processing threads from the plurality of packet processing threads, and the state of each one of the packet processing threads from the backlogged pool is the backlogged state, processing the packet in the second packet processing thread, and forwarding the packet according to a predetermined order, wherein the predetermined order is based on a position of the packet relative to positions of other packets at their receipt in the network device. mapping the packet to a second packet processing thread from the backlogged pool of packet processing threads based on a load balancing scheme, wherein the backlogged pool of packet processing threads includes the first packet processing thread and a subset of packet processing threads from the plurality of packet processing threads, and the state of each one of the packet processing threads from the backlogged pool is the backlogged state, processing the packet in the second packet processing thread, and forwarding the packet according to a predetermined order, wherein the predetermined order is based on a position of the packet relative to positions of other packets at their receipt in the network device.