On Tue, Dec 20, 2011 at 8:24 AM, Tim Goetze <tim(a)quitte.de> wrote:
Alternatively, out-of-order queuing can be dealt with
by sorting the
contents of the FIFO in the consuming thread (since the write position
only ever increases, sorting everything before it is safe).
as long as the length of the FIFO is relatively small, this is true.
sorting is rarely linear though, so you need to be careful if you want
this to scale to absurdly large message queues :)
Multiple
writers can be supported locklessly by employing one FIFO per writing
thread (the consuming thread peeks at the contents of all FIFOs before
deciding which event to pop first).
true, though this is more complex for the reader, and the writers are
rarely under RT constraints which means that the serialization via a
lock doesn't hurt anyone.