1. A method for routing a data packet comprising: receiving the packet at a first device; producing at least one thread associated with routing the packet, the thread including a sequence of instructions; assigning a thread identifier (TID) to each of the threads and maintaining an activity status for each thread; for each instruction, selecting a pipeline from a plurality of processing pipelines such that no instruction in the selected pipeline depends on a preceding instruction because every instruction in the selected pipeline is associated with a different thread; executing the instructions in the selected pipelines; and transmitting the packet from the first device to a second device.