1. A queue shared by a producing device and a consuming device, the queue comprising: a region of an electronic memory allocated for the queue, the memory region containing queue slots, each slot having a size sufficient to store a queue entry, and each queue entry including a discard field; additional memory locations that store values corresponding to a producer index, a consumer index, and a queue length; producer-device logic that queues a queue entry to the queue and correspondingly updates the producer index; and consumer-device logic that dequeues an entry from the queue and correspondingly updates the consumer index, processing the dequeued entry when the contents of the discard field of the entry indicate that the entry should be processed, and discarding the entry when the contents of the discard field of the entry indicate that the entry should be discarded.