Check out my first novel, midnight's simulacra!

Bip buffers: Difference between revisions

From dankwiki
(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.

Latest revision as of 17:15, 9 July 2009

A variant of circular buffer, popularized by Simon Cooke on the 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's mremap_file_pages(2)/mremap(2) or, on other operating systems, mmap(MAP_FIXED) to effect accordion buffering using a single underlying circlebuffer that's just as fast (and more resource-efficient) as a multiple buffer solution.