Patent ID: 8428075

Claim:
A method comprising: storing, by a processor of a device, a first data unit in a data queue; receiving, by the processor, a second data unit to be stored in the data queue after storing the first data unit; determining, by the processor, that the data queue does not include sufficient available space to store both the first data unit and the second data unit; allocating, by the processor, space in the data queue to store the second data unit, the allocating of the space including: determining whether an output port, associated with the first data unit, is available, performing, when the output port is available, a de-queue operation, the de-queue operation including removing the first data unit from the data queue, and performing, when the output port is unavailable, a head drop operation that includes removing the first data unit from the data queue; and performing, by the processor, an en-queue operation that includes writing the second data unit to the allocated space in the data queue, the en-queue operation being performed in parallel with the de-queue operation or the head drop operation.