Bip buffers: Difference between revisions

Created page with 'A variant of circular buffer, popularized by Simon Cooke on the [http://www.codeproject.com/KB/IP/bipbuffer.aspx CodeProject].'
 
No edit summary
 
Line 1: Line 1:
A variant of circular buffer, popularized by Simon Cooke on the [http://www.codeproject.com/KB/IP/bipbuffer.aspx CodeProject].
A variant of circular buffer, popularized by Simon Cooke on the [http://www.codeproject.com/KB/IP/bipbuffer.aspx CodeProject]. The "bip" stands for "bipartite".
 
I've improved Cooke's bip buffers for the case where the buffer must be able to dynamically grow (ie, due to irregular [[TCP]] patterns), using [[Linux APIs|Linux's]] <tt>mremap_file_pages(2)/mremap(2)</tt> or, on other operating systems, <tt>mmap(MAP_FIXED)</tt> to effect accordion buffering using a single underlying circlebuffer that's just as fast (and more resource-efficient) as a multiple buffer solution.