Adding (appending) new items to our queue
Finally, we'll considered adding new items to our queue.
Remember two of our objectives:
- To quickly add items -
we don't wish appending to a very long queue to be slow.
We achieve this by remembering where the tail of the queue is,
and quickly adding to it without searching.
- To be able to queue data that we don't "understand".
We achieve this by treating all data as "a block of bytes",
allocating memory for it,
copying it (as we're told its length),
all without ever interpreting its contents.
CITS2002 Systems Programming, Lecture 19, p16, 3rd October 2023.
|