Lines Matching full:reader
34 - the task that reads from the buffer (same as reader)
36 reader
41 by the reader.
44 - a pointer to the page that the reader will use next
98 same time, nor can a reader preempt/interrupt another reader. A reader
100 buffer at the same time as a writer is writing, but the reader must be
101 on another processor to do so. A reader may read on its own processor
104 A writer can preempt a reader, but a reader cannot preempt a writer.
105 But a reader can read the buffer at the same time (on another processor)
110 At initialization a reader page is allocated for the reader that is not
116 The reader page is initialized to have its next pointer pointing to
120 The reader has its own page to use. At start up time, this page is
121 allocated but is not attached to the list. When the reader wants
123 it will swap its page with the head_page. The old reader page will
128 Once the new page is given to the reader, the reader could do what
131 A sample of how the reader page is swapped: Note this does not
138 |reader| RING BUFFER
151 |reader| RING BUFFER
164 |reader| RING BUFFER
183 | | Reader +---+ +---+ +---+ |
196 reader page commit page tail page
213 since the reader page still points to the next location in the ring
219 reader page
220 - The page used solely by the reader and is not part
225 with the reader page.
338 swapped with the reader page. This is because the head page is always
339 part of the ring buffer, but the reader page is not. Whenever there
341 and a reader swaps out a page, it will be swapping out the commit page.
345 reader page commit page tail page
367 The reader cannot swap a page into the ring buffer if the commit page
413 Note, the reader page will still point to the previous head page.
421 of the head_page pointer with the swapping of pages with the reader.
443 reader page
458 the next page is the next page to be swapped out by the reader.
483 Any access to the reader will need to take some sort of lock to serialize
485 ring buffer. This means we only need to worry about a single reader,
488 When the reader tries to swap the page with the ring buffer, it
491 and the reader will need to look for the new head page and try again.
494 The reader swaps the reader page as follows::
497 |reader| RING BUFFER
508 The reader sets the reader page next pointer as HEADER to the page after
513 |reader| RING BUFFER
526 point to the reader page. Note that the new pointer does not have the HEADER
530 |reader| RING BUFFER
543 updated to the reader page::
546 |reader| RING BUFFER
565 | | Reader +---+ +---+ +---+ |
571 Another important point: The page that the reader page points back to
573 never points back to the reader page. That is because the reader page is
578 Note, the way to determine a reader page is simply by examining the previous
580 point back to the original page, then the original page is a reader page::
584 | reader | next +----+
599 flag to have the UPDATE flag set. Once this is done, the reader will
603 This eliminates any races that the reader can have on the writer. The reader
604 must spin, and this is why the reader cannot preempt the writer::
661 reader page? The commit page is not part of the ring buffer. The tail page
665 reader page commit page
684 leaving the reader page would not be pointing to the correct page.
686 The solution to this is to test if the commit page is on the reader page
693 tail page. The reader cannot swap the reader page if it is also being
694 used as the commit page. The reader can simply check that the commit
695 is off the reader page. Once the commit page leaves the reader page
696 it will never go back on it unless a reader does another swap with the
972 the reader from seeing the incorrect head page::