Messages in this thread | | | Date | Wed, 10 Jun 2009 23:25:46 -0400 (EDT) | From | Steven Rostedt <> | Subject | Re: [PATCH 3/3] ring-buffer: add design document |
| |
On Thu, 11 Jun 2009, Hidetoshi Seto wrote: > Steven Rostedt wrote: > > + > > + +------+ > > + |reader| RING BUFFER > > + |page |-------------------+ > > + +------+ <---------------+ v > > + | ^ +---+ +---+ +---+ > > + | | | |-->| |-->| | > > + | | | |<--| |<--| |<-+ > > + | | +---+ +---+ +---+ | > > + | | | ^ | | > > + | | +-------------+ | | > > + | +-----------------------------+ | > > + +------------------------------------+ > > It seems the middle of three pages have 2 prev arrows... ?
Yes that is a mistake. Thanks, I'll fix it. > > + > > +It does a cmpxchg with the pointer to the previous head page to make it > > +point to the reader page. Note that the new pointer does not have the HEADER > > +flag set. This action atomically moves the head page forward. > > + > > + +------+ > > + |reader| RING BUFFER > > + |page |-------H-----------+ > > + +------+ <---------------+ v > > + | ^ +---+ +---+ +---+ > > + | | | |-->| |-->| | > > + | | | |<--| |<--| |<-+ > > + | | +---+ +---+ +---+ | > > + | | | ^ | | > > + | | +-------------+ | | > > + | +-----------------------------+ | > > + +------------------------------------+ > > + > > Ditto.
Ditto too ;-)
Thanks,
-- Steve
| |