|
|||||
|
|
#11 |
|
|
news:878xao6om6.fsf@bsb.me.uk... > > I think you need to say more. Without the 'next' pointer, what good > would the structure be? You could make an array of them and use it > like the ring buffer example but then why have the value in a > structure at all? Why not just hold an array and head/tail counters in the structure. And to track down the changes of head and through functions. > > The 'next' pointer is to make a linked list to (presumably) store the > queued items. How does the 'fifo_node' structure know about head and tail of queue, there's nothing mentioned in structure? -- Best regards, Roman |
|
|
#12 |
|
|
"Richard Heathfield" <rjh@see.sig.invalid> wrote in message news:P46dne32OrkIDe3bnZ2dnUVZ8qydnZ2d@bt.com... >> Why not just hold an array and head/tail counters in the structure. > > That's fine, as long as you know in advance that you won't need to make > the ring buffer larger at runtime. > > You might not. > I seem to realize your point. The linked list of FIFO nodes lets us to have 'rubber' queue, of flexible size. But then we don't have markers of head and tail, what to do with that? -- Best regards, Roman |